Part Number Hot Search : 
IP82C83H LL4148 05030 SB315 B10100 00113 8ETL06FP 10000
Product Description
Full Text Search
 

To Download 71M6531F-IMFPE8 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  71m6531d/f, 71m6532d/f energy meter ic simplifying system integration tm data sheet 19 - 5374; rev 1; 4/13 rev 2 1 general description the 71m6531d/f and 71m6532d/f are highly in te grated soc s with an mpu core, rtc, flash and lcd driver. the patented single converter technology ? with a 22 - bit delta - sigma adc, four analog inputs, digital tempera- ture com pensation, pre cision voltage re f erence, battery voltage monitor and 32 - bit com puta tion engine (ce) supports a wide range of re sidential metering applications with very few low - cost external com ponents. a 32 - khz crystal time base for the entire system and internal bat tery backup support for ram and rtc further re duce system cost. the ic supports 2 - wire, and 3- wire single - phase and dual - phase re sidential metering along with tamper - detection me chanisms. the 71m6531d/f offers single - ended input s for two current channel s and two single - ended voltage inputs . t he 71m6532 d/f has two differential current inputs and three sin gle - ended voltage input s. maximum design flexibility is provided by multiple uarts, i 2 c, wire, up to 21 dio pins and in - system programmable flash memory, which can be updated with data or application code in operation. a complete array of ice and development tools, programming libraries and reference designs enable rapid development and certification of tou, amr and prepay meters that comply with worldwide electricity metering stan dards. mpu timers iap* va ibp* xin xout vref rx/dio1 tx/dio2 v1 txrx com0..3 v3.3a v3.3sys vbat v2.5 vbias gnda gndd seg/dio ice i/f load 88 . 88 . 8888 i2c or wire eeprom power fault amr test pulses comparator sense drive/mod serial ports osc/pll adc lcd & dio compute engine flash memory ram voltage ref regulator power supply 71m653171m6532 temp sensor 32 khz a neutral ct/shunt 02/18/2009 vb b load ir pwr mode control wake-up battery ice_e gndd v3p3d ian* ibn* ct spi host spi lcd seg rtc * differential pins only on 6532d/f features ? wh accuracy < 0.1% over 2000:1 current range ? exceeds iec620 53/ ansi c1 2.20 standards ? four sensor inputs ? low - jitter wh and varh plus two additional pulse test outputs (4 total, 10 khz maximum) with pulse count ? four - quadrant metering ? tamper detection ( neutr al current with ct, rogowski or shunt , m agnetic tamper in put ) ? line frequency count for rtc ? digital temperature compensation ? sag detection for phase a and b ? independent 32 - bit compute engine ? 46 - 64 hz line frequency range with same calibration . phase compensation ( 7 ) ? three battery modes with wake - up on timer or push - button: brownout m ode (52 a typ. ) lcd m ode (2 1 a typ. , dac active ) sleep m ode (0.7 a typ. ) ? energy display during main s power failure ? 39 mw typical consumption @ 3.3 v, mpu clock frequency 614 khz ? 22 - bit delta - sigma adc with 3360 hz or 2520 hz sample rate ? 8- bit mpu (80515),1 clock cycle per in struction , 10 mhz maximum, with integrated ice for debug ? rtc for tou functions with clock - rate adjust register ? hardware watchdog timer, power fail monitor ? lcd driver with 4 common segment drivers : u p to 156 (71m6531d/f) or 268 pixels (71m6532d/f) ? up to 22 (71m6531 d/f ) or 43 ( 71m6532 d/f ) general - purpose i/o pins. digital i/o pins compatible with 5 v inputs ? 32 khz time base ? high - speed slave spi interface to data ram ? two uarts for ir and amr , ir driver with modulation ? flash memory with security and in - system program update : 128 kb (71m6531d /32d ) 256 kb (71m6531 f/ 32 f) ? 4 kb mpu xram ? industrial temperature range ? 68 - pin qfn package for 71m6531d/f pin - compatible with 71m6521 , 100 - pin lqfp package for 71m6532 d/f , lead free downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 2 rev 2 table of contents 1 hardware description ....................................................................................................................... 10 1.1 hardware overview ................................................................................................................... 10 1.2 analog front end (afe) ............................................................................................................. 10 1.2.1 signal input pins ............................................................................................................ 10 1.2.2 input multiplexer ............................................................................................................. 11 1.2.3 a/d converter (adc) ..................................................................................................... 12 1.2.4 fir filter ........................................................................................................................ 12 1.2.5 voltage references ....................................................................................................... 12 1.2.6 temperature sensor ...................................................................................................... 14 1.2.7 battery monitor ............................................................................................................... 14 1.2.8 afe functional description ........................................................................................... 14 1.2.9 digital computation engine (ce) ................................................................................... 15 1.2.10 meter equations ............................................................................................................. 16 1.2.11 real - time monitor ......................................................................................................... 16 1.2.12 pulse generators ........................................................................................................... 16 1.2.13 data ram (xram) ........................................................................................................ 17 1.2.14 delay compensation ..................................................................................................... 17 1.2.15 ce functional overview ................................................................................................ 17 1.3 80515 mpu core ....................................................................................................................... 19 1.3.1 memory organization and addressing .......................................................................... 19 1.3.2 special function registers (sfrs) ................................................................................ 21 1.3.3 generic 80515 special function registers ................................................................... 22 1.3.4 sp ecial function registers (sfrs) specific to the 71m6531d/f and 71m6532d/ f ..... 24 1.3.5 instruction set ................................................................................................................ 26 1.3.6 uarts ........................................................................................................................... 26 1.3.7 timers and counters ..................................................................................................... 28 1.3.8 wd timer (software watchdog timer) ......................................................................... 30 1.3.9 interrupts ........................................................................................................................ 30 1.4 on - chip resources ................................................................................................................... 36 1.4.1 oscillator ........................................................................................................................ 36 1.4.2 intern al clocks ............................................................................................................... 36 1.4.3 real - time clock (rtc) ................................................................................................ . 37 1.4.4 temperature sensor ...................................................................................................... 38 1.4.5 physical memory ............................................................................................................ 38 1.4.6 optical interface ............................................................................................................. 40 1.4. 7 digital i/o C 71m6531d/f .............................................................................................. 41 1.4.8 digital i/o C 71m6532d/f .............................................................................................. 43 1.4.9 digital io C common characteristics for 71m6531d/f and 71m6532d/f .................... 44 1.4.10 lcd drivers C 71m6531d/f .......................................................................................... 45 1.4.11 lcd drivers C 71m6532d/f .......................................................................................... 46 1.4.12 lcd drivers C common characteristics for 71m6531d/f and 71m6532d/f ............... 46 1.4.13 battery monitor ............................................................................................................... 46 1.4.14 eeprom interface ........................................................................................................ 46 1.4.15 spi slave port ................................................................................................................ 49 1.4.16 hardware watchdog timer ............................................................................................ 52 1.4.17 test ports (tmuxout pin) ........................................................................................... 53 downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 3 2 functional description ..................................................................................................................... 54 2.1 theory of operation ................................................................................................................... 54 2.2 system timing summary ........................................................................................................... 55 2. 3 battery modes ............................................................................................................................ 56 2.3.1 brownout mode ....................................................................................................... 57 2.3.2 lcd mode ...................................................................................................................... 58 2.3.3 sleep mode ................................................................................................................. 58 2.4 fault and reset behavior .......................................................................................................... 60 2.4.1 reset mode .................................................................................................................... 60 2.4.2 power fault circuit ........................................................................................................ 60 2.5 wake - up behavior ..................................................................................................................... 61 2.5.1 wake on pb ................................................................................................................... 61 2.5.2 wake o n timer ............................................................................................................... 61 2.6 data flow ................................................................................................................................... 61 2.7 ce/mpu communication ........................................................................................................... 62 3 application information .................................................................................................................... 63 3.1 connection of sensors ............................................................................................................... 63 3. 2 connecting 5 - v devices ............................................................................................................ 63 3.3 temperature measurement ....................................................................................................... 64 3.4 temperature compensation ...................................................................................................... 64 3.4.1 temperature coefficients: ............................................................................................. 64 3.4.2 temperature compensation for vref .......................................................................... 65 3.4.3 system temperature compensation ............................................................................. 65 3.4.4 temperature compensation for the rtc ...................................................................... 65 3.5 connecting lcds ....................................................................................................................... 66 3.6 connecting i 2 c eeproms ........................................................................................................ 66 3.7 connecting three - wire eeproms ........................................................................................... 67 3.8 uart0 (t x/rx) ......................................................................................................................... 67 3.9 optical interface (uart1) .......................................................................................................... 67 3.10 connecting the v1 pin ............................................................................................................... 68 3.11 connecting the reset pin .......................................................................................................... 69 3.12 connecting the emulator port pins ............................................................................................ 69 3.13 connecting a battery ................................................................................................................. 69 3.14 flash programming .................................................................................................................... 70 3.15 mpu firmware ........................................................................................................................... 70 3.16 crystal oscillator ........................................................................................................................ 70 3.17 meter calibration ........................................................................................................................ 71 4 firmware interface ............................................................................................................................ 72 4.1 i/o ram and sfr map C functional order ............................................................................... 72 4.2 i/o ram description C alphabetical order ................................................................................ 77 4.3 ce interface description ............................................................................................................ 88 4.3.1 ce program ................................................................................................................... 88 4.3.2 ce data format ............................................................................................................. 88 4.3.3 constants ....................................................................................................................... 88 4.3.4 environment ................................................................................................................... 88 4.3.5 ce calculations ............................................................................................................. 89 4.3.6 ce status and control ................................................................................................... 89 4.3.7 ce transfer variables ................................................................................................... 92 4.3.8 pulse generation ........................................................................................................... 93 4.3.9 ce calibration parameters ............................................................................................ 94 downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 4 rev 2 4.3.10 other ce parameters .................................................................................................... 95 4.3.11 ce flow diagrams ......................................................................................................... 95 5 electrical specifications ................................................................................................................... 98 5.1 absolute maximum ratings ....................................................................................................... 98 5.2 recommended external components ....................................................................................... 99 5.3 recommended operating co nditions ........................................................................................ 99 5.4 performance specifications ..................................................................................................... 100 5.4.1 input logic levels ........................................................................................................ 100 5.4.2 output logic levels ..................................................................................................... 100 5.4.3 power - fault comparator ............................................................................................. 100 5.4.4 battery monitor ............................................................................................................. 100 5.4.5 supply current ............................................................................................................. 101 5.4.6 v3p3d switch .............................................................................................................. 101 5.4.7 2.5 v voltage regulator ............................................................................................... 101 5.4.8 low - power voltage regulator ..................................................................................... 101 5.4.9 crystal oscillator .......................................................................................................... 102 5.4.10 lcd dac ..................................................................................................................... 102 5.4.11 lcd drivers ................................................................................................................. 102 5.4.12 optical interface ........................................................................................................... 102 5.4.13 temperature sensor .................................................................................................... 103 5.4.14 vref ........................................................................................................................... 103 5.4.15 adc converter, v3p3a referenced ............................................................................ 104 5.5 timing specifications ............................................................................................................... 106 5.5.1 flash memory .............................................................................................................. 106 5.5.2 eeprom interface ...................................................................................................... 106 5.5.3 reset ......................................................................................................................... 106 5.5.4 rtc .............................................................................................................................. 106 5.5.5 spi slave port (mission mode) ................................................................................. 107 5.6 typical performance data ....................................................................................................... 108 5.6.1 accuracy over current ................................................................................................ . 108 5.6.2 accuracy over temperature ........................................................................................ 108 5.7 71m6531d/f package ............................................................................................................. 109 5.7.1 package outline .......................................................................................................... 109 5.7.2 71m6531d/f pinout (qfn - 68) ..................................................................................... 110 5.7.3 recommended pcb land pattern for the qfn - 68 package ...................................... 111 5.8 71m6532d/f package ............................................................................................................. 112 5.8. 1 71m6532d/f pinout (lqfp - 100) ................................................................................. 112 5.8.2 lqfp - 100 mechanical drawing ................................................................................... 113 5.9 pin descriptions ....................................................................................................................... 114 5.9.1 power and ground pins ............................................................................................... 114 5.9.2 analog pins .................................................................................................................. 114 5.9.3 digital pins ................................................................................................................... 115 5.9.4 i/o equivalent circuits ................................................................................................ . 116 6 ordering information ...................................................................................................................... 117 7 related information ........................................................................................................................ 117 8 cont act information ........................................................................................................................ 117 appendix a: acronyms .......................................................................................................................... 118 appendix b: revision history ................................................................................................................ 119 downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 5 figures figure 1: 71m6531d/f ic functional block diagram ................................................................................... 8 figure 2: 71m6532d/f ic functional block diagram ................................................................................... 9 figure 3: general topology of a chopped amplifier .................................................................................. 13 figure 4: cross signal with chop_e[1:0] = 00 ....................................................................................... 13 figure 5: afe block diagram (shown for the 71m6532 d/f) ...................................................................... 14 figure 6: samples from multiplexer cycle .................................................................................................. 18 figure 7: accumulation interval ................................................................................................................... 18 figure 8: interrupt structure ........................................................................................................................ 35 figure 9: optical interface ........................................................................................................................... 41 figure 10: connecting an external load to dio pins ................................................................................. 45 figure 11: 3 - wire interface. write command, hiz=0 ................................................................................ 48 figure 12: 3 - wire interface. write command, hiz=1 ................................................................................ 48 figure 13: 3 - wire interface. read command. ........................................................................................... 49 figure 14: 3 - wire interface. write command when cnt=0 ...................................................................... 49 figure 15: 3 - wire interface. write command when hiz=1 a nd wfr=1 ................................................... 49 figure 16: spi slave port: typical read and write operations .................................................................. 51 figure 17: functions defined by v1 ............................................................................................................ 52 figure 18: voltage, current, momentary and accumulated energy ........................................................... 54 figure 19: timing relationship between adc mux, compute en gine ...................................................... 55 figure 20: rtm output format ................................................................................................................... 55 figure 21: operation modes state diagram ............................................................................................... 56 figure 22: transition from brownout to mission mode when system power returns ...................... 59 figure 23: power - up timing with v3p3sys and vbat tied together ........................................................ 59 figure 24: pow er - up timing with vbat only .............................................................................................. 60 figure 25: wake up timing ........................................................................................................................ 61 figure 26: mpu/ce data flow .................................................................................................................... 62 figure 27: mpu/ce communication ........................................................................................................... 62 figure 28: resistive voltage divider ........................................................................................................... 63 figure 29: ct with single ended (left) and differential input (right) connect ion ..................................... 63 figure 30: resistive shunt (left) and rogowski sensor (right) connection ............................................. 63 figure 31: connecting lcds ....................................................................................................................... 66 fi gure 32: i 2 c eeprom connection .......................................................................................................... 66 figure 33: three - wire eeprom connection ............................................................................................. 67 figure 34: connections for uart0 ............................................................................................................. 67 figure 35: connection for optical components .......................................................................................... 68 figure 36: voltage divider for v1 ................................................................................................................ 68 figure 37: external components for the reset pin: push - button (left), production circuit (right) ........ 69 figure 38: external components for the emulator interface ...................................................................... 69 figure 39: connecting a battery ................................................................................................................. 70 figure 40: ce data flow: multiplexer and adc .......................................................................................... 96 figure 41: ce data flow: scaling, gain control, intermediate variables .................................................. 96 figure 42: ce data flow: squaring and summation stages ...................................................................... 97 figure 43: spi slave port (mission mode) timing ................................................................................. 107 figure 44: wh accuracy, 0.1 a to 200 a at 240 v/50 hz and room temperature .................................. 108 figure 45: qfn - 68 package outline, top and side view ........................................................................ 109 figure 46: qfn - 68 package outline, bottom view .................................................................................. 109 figure 47: pinout for qfn - 68 package ..................................................................................................... 110 figure 48: pcb land pattern for qfn 68 package .................................................................................. 111 figure 49: pcb land pattern for lqfp - 100 package .............................................................................. 112 figure 50: lqfp - 100 package, mechanical drawing ............................................................................... 113 figure 51: i/o equivalent circuits ............................................................................................................. 116 downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 6 rev 2 tables table 1: inputs selected in regular and alternate multiplexer cycles ....................................................... 11 table 2: adc resolution ............................................................................................................................. 12 table 3: adc ram locations ..................................................................................................................... 12 table 4: xram locations for adc results ................................................................................................ 15 table 5: meter equations ............................................................................................................................ 16 table 6: ckmpu clock frequencies .......................................................................................................... 19 table 7: memory map ................................................................................................................................ . 20 table 8: internal data memory map ........................................................................................................... 21 table 9: special function register map ..................................................................................................... 21 table 10: generic 80515 sfrs - location and reset values .................................................................... 22 table 11: psw bit functions ( sfr 0xd0 ) ..................................................................................................... 23 table 12: port registers ............................................................................................................................. 24 tabl e 13: stretch memory cycle width ...................................................................................................... 24 table 14: 71m6531d/f and 71m6532d/f specific sfrs ........................................................................... 24 table 15: baud rate generation ................................................................................................................ 26 table 16: uart modes ............................................................................................................................... 26 table 17: the s0con (uart0) register (sfr 0x98) ................................................................................. 27 table 18: the s1con (uart1) register (sfr 0x9b) .................................................................................. 27 table 19: pcon register bit description (sfr 0x87) ................................................................................ 28 table 20: timers/counters mode description ............................................................................................ 28 table 21: allowed timer/counter mode combinations .............................................................................. 29 table 22: tmod register bit description (sfr 0x89) ................................................................................ 29 table 23: the tcon register bit functions (sfr 0x88) ............................................................................ 29 table 24: the ien0 bit functions (sfr 0xa8) ............................................................................................ 30 table 25: the ien1 bit fun ctions (sfr 0xb8) ............................................................................................ 31 table 26: the ien2 bit functions (sfr 0x9a) ............................................................................................ 31 table 27: tcon bit functions (sfr 0x88) ................................................................................................ . 31 table 28: the t2con b it functions (sfr 0xc8) ........................................................................................ 31 table 29: the ircon bit functions (sfr 0xc0) ........................................................................................ 31 table 30: external mpu interrupts .............................................................................................................. 32 table 31: interrupt enable and flag bits .................................................................................................... 32 table 32: interrupt priority level groups .................................................................................................... 33 table 33: interrupt priority levels ............................................................................................................... 33 table 34: interrupt priority registers ( ip0 and ip1 ) .................................................................................... 34 table 35: interrupt polling sequen ce .......................................................................................................... 34 table 36: interrupt vectors .......................................................................................................................... 34 table 37: clock system summary .............................................................................................................. 36 table 38: bank switching with fl_bank[2:0] ............................................................................................ 40 table 39: data/direction registers and internal resources for dio 1 - 15 (71m6531d/f ) ......................... 42 table 40: data/direction registers and internal resources for dio 17 - 29 (71m6531d/f) ....................... 42 table 41: data/direction registers and internal resources for dio 43 - 46 (71m6531d/f) ....................... 42 table 42: data/direction registers and internal resources for dio 1 - 15 (71m6532d/f) ......................... 43 table 43: data/direction registers and internal resources for dio 16 - 30 (71m6532d/f) ....................... 43 table 44: data/direction registers and internal resources for dio 40 - 51 (71m6532d/f) ....................... 44 table 45: dio_dir control bit .................................................................................................................... 44 table 46: selectable control using dio_dir bits ......................................................................................... 44 table 47: eectrl bits for 2 - pin interface ................................................................................................... 47 table 48: eectrl bits for the 3 - wire interface .......................................................................................... 48 table 49: spi command description .......................................................................................................... 50 table 50: i/o ram registers accessible via spi ....................................................................................... 50 table 51: tmux[4:0] selections ................................................................................................................. 53 table 52: available circuit functions .......................................................................................................... 57 downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 7 table 53: i/o ram map in functional order ............................................................................................... 72 table 54: i/o ram description - alphabetical ............................................................................................ 77 table 55: ce equ[2:0] equations and element input mapping ................................................................ . 89 table 56: cestatus (ce ram 0x80) bit definitions .................................................................................. 90 table 57: ceconf ig bit definitions ........................................................................................................... 91 table 58: sag threshold control ................................................................................................................ 91 table 59: gain adjust control ..................................................................................................................... 91 table 60: ce transfer variables ................................................................................................................. 92 table 61: ce energy measurement variables ............................................................................................ 92 table 62: useful ce measurement parameters ......................................................................................... 93 table 63: ce pulse generation parameters ............................................................................................... 94 table 64: ce calibration parameters ......................................................................................................... 94 table 65: ce parameters for noise suppression and code version ......................................................... 95 table 66: absolute maximum ratings ........................................................................................................ 98 table 67: recommended external components ........................................................................................ 99 table 68: recommended operating conditions ......................................................................................... 99 table 69: input logic levels ..................................................................................................................... 100 table 70: output logic levels .................................................................................................................. 100 table 71: power - fault comparator performance specifications ............................................................. 100 table 72: battery monitor performance specifications ( bme = 1) ............................................................. 100 table 73: supply current performance specifications ............................................................................. 101 table 74: v3p3d switch performance specifications .............................................................................. 101 table 75: 2.5 v voltage regulator performance specifications ............................................................... 101 table 76: low - power voltage regulator performance specifications ..................................................... 101 table 77: crystal oscillator performance specifications .......................................................................... 102 table 78: lcd dac performance specifications ..................................................................................... 102 table 79: lcd driver performance specifications ................................................................................... 102 table 80: optical interface performance specifications ........................................................................... 102 table 81: temperature sensor performance specifications .................................................................... 103 table 82: vref performance specifications ............................................................................................ 103 table 83: adc converter performance specifications ............................................................................. 104 table 84: flash memory timing specifications ........................................................................................ 106 table 85: eeprom interface timing ........................................................................................................ 106 table 86: reset timing .......................................................................................................................... 106 table 87: spi slave port (mission mode) timing .................................................................................. 107 table 88: recommended pcb land pattern dimensions ........................................................................ 111 table 89: power and ground pins ............................................................................................................ 114 table 90: analog pins ............................................................................................................................... 114 table 91: digital pins ................................................................................................................................ 115 downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 8 rev 2 figure 1 : 71m6531d/f ic functional block diagram downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 9 figure 2 : 71m6532d/f ic functional block diagram downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 10 rev 2 1 hardware description 1.1 hardware overview the 71m6531 d/f and 71m6532d/f single - chip energy meter s integrate s all primary functional blocks required to implement a solid - state electricity met er. included on the chip s are : ? an a nalog front end (afe) ? an i ndependent digital computation engine (ce) ? an 8051 - compatible microprocessor (mpu) which executes one instruction per clock cycle (80515) ? a voltage reference ? a temperature sensor ? lcd drivers ? ram and flash memory ? a real time clock (rtc) ? a variety of i/o pi ns various current sensor technologies are supported including current transformers (ct ), resistive shunts and rogowski coils. in a typical application, the 32 - bit compute engine (ce) of the 71m6531 d/f and 71m6532d/f sequentially process the samples from the voltage inputs on pins ia, va, ib, vb and performs calculations to measure active energy (wh) and reactive energy (varh), as well as a 2 h and v 2 h for four - quadrant metering. these measurem ents are then accessed by the mpu, processed further and output using the peri pheral devices available to the mpu. in addition to advanced measurement functions, the real time clock function al lows the 71m6531 d/f and 71m6532d/f to record time of use (tou) metering information for multi - rate applications and to time - stamp tamper events. measurements can be displayed on 3.3 v lcds commonly used in low - temperature envi ronments. flexible mapping of lcd display segments facilitate integrat ion of existing custom lcds. design trade - off between the number of lcd segments and dio pins can be implemented in software to accommodate various require ments. in addition to the temperature -t rimmed ultra - precision voltage reference, the on - chip digital temperature com pensation mechanism includes a temperature sensor and associated controls for correct ion of unwanted temperature effects on meas ure ment and rtc accuracy, e.g. to meet the requirements of ansi and iec standards . temperature - dependent external components such as a crystal oscillator , current transformers (cts) and their corresponding signal conditioning circuits can be characterized and their correction factors can be programme d to produce electricity meters with exceptional accuracy over the in dustrial temperature range. one of the two internal uarts is adapted to support an infrared l ed with interna l drive and sense configuration and can also function as a standard uart. the optical output can be modulated at 38 khz. this flexibility makes it possible to implement amr meters with an ir interface. a block diagram of the 71m6531 d/f ic is shown in figure 1 . a block diagram of the 71m6532d/f ic is shown in figure 2 . 1.2 analog front end (afe) the afe consists of an input multiplexer, a delta - sigma a/d converter and a voltage reference. 1.2.1 signal input pins all analog signal input pins are sensitive to voltage. in the 71m6531d/f, t he va and vb pins , as well as the ia and ib pins are single - ended. in the 71m6532d/f , the iap/ian and ibp/ibn pin s can be programmed individually to be differential (see i/o ram bit sel_ian and sel_ibn ) or single - ended. the differential signal is applied between the iap and ia n input pins and between the ibp and ibn input pin s . single - ended s ignals are applied to the iap and ibp input pin s whereas the common signal, return, is the v3p3a pin. when using the differential mode, inputs can be chopped, i.e. a connection from v3p 3a to iap or ia n (or ibp an ibn, respectively) alternates in each mu ltip lexer cycle. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 11 1.2.2 input multiplexer the input multiplexer supports up to four input signals that are applied to pins ia (i ap/ian) , va, ib (ibp/ibn) , and vb of the de vice. additionally, using the alternate multiplexer selection, it ha s the ability to select temperature and the battery voltage. the multiplexer can be operated in two modes: ? during a normal multiplexer cycle, the signals from the ia (iap/ian) , ib (ibp/ibn) , va and vb pins are selected. ? during the alternate multiplexer cy cle, the temperature signal (temp) and the battery monitor are selected, along with some of the voltage and/or current signal sources show n in table 1 . to prevent un necessary drainage on the battery, the battery monitor is only active when enabled with the bme bit (0x2020[6]) in the i/o ram. the alternate multiplexer cycles are usually performed infrequently (every s econd or so) by the mpu. in order to prevent disrup tion of the voltage tracking pll and voltage allpass networks, va is not r eplaced in the alt selections. table 1 detail s the regular and alternative multiplexer sequences. the computation engine ( ce ) fills in missing samples due to an alt multiplexer sequence . table 1 : inputs selected in regular and altern ate multiplexer cycles time slot regular slot alternate slot register typical selections register typical selections ram address signal for adc ram address signal for adc 0 slot0_sel [3:0] 0 ia slot0_altsel [3:0] a temp 1 slot1_sel [3:0] 1 vb slot1_altsel [3:0] 1 vb 2 slot2_sel [3:0] 2 ib slot2_altsel [3:0] b vbat 3 slot3_sel [3:0] 3 va slot3_altsel [3:0] 3 va C slot4_sel [3:0] C C slot4_altsel [3:0] C C C slot5_sel [3:0] C C slot5_altsel [3:0] C C C slot6_sel [3:0] C C slot6_altsel [3:0] C C C slot7_sel [3:0] C C slot7_altsel [3:0] C C C slot8_sel [3:0] C C slot8_altsel [3:0] C C C slot9_sel [3:0] C C slot9_altsel [3:0] C C the sequence of sampled channels is fully programmable using i/o ram registers. slotn_sel [3:0] se lects the input for the nth state in a standard multiplexer frame, whi le slotn_altsel [3:0] selects the input for the nth state in an alternate multiplexer frame. the states shown in table 1 are examples for possible multiplexer state sequences. in a typical application, ia (ian/iap) and ib (ibn/ibp) are connected to current transformers that sense the current on each phase of the line voltage. va and vb are typically connected to voltage sensors through resistor dividers. the multiplexer control circuit (mux_ctrl signal) controls multiplex er advance, fir initiation and vref chopping . additionally, mux_ctrl launches each pass through the ce program. conceptually, mux_ctrl is clocked by ck32, the 32768 hz clock from the pll block. the behavior of mux_ctrl is governed by mux_alt , equ [2:0] , chop_e[1:0] and mux_div[3:0] . the mux_alt bit requests an alternative multiplexer frame. the bit may be asserted on any mpu cycle and may be subsequently de - asserted on any cycle including the next one. a rising edge on mux_alt will cause mux_ctrl to wait until the next multiplexer frame and i mplement a single alternate multiplexer frame. another control input to the mux is mux_div[3:0] . these four bits can request from 1 to 10 multiplexer states per frame. the multiplexer always starts at the beginning of its list and proceeds until the number of states defined by mux_div[3:0] have been converted. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 12 rev 2 the duration of each multiplexer state depends on the number of adc samples processed by the fir, which is set by fir_len[1:0] . each multiplexer state will start on the rising edge of ck32. the mux_ctrl signal sends an fir_start command to begin the calculation of a sample val ue from the adc bit stream by the fir. upon receipt of the fir_done signal from the fir, the multiplexer will wait until the next ck32 rising edge to increment its state and initiate the next fir conversion. fir conversions require 1, 2, or 3 ck32 cycles. the number of ck32 cycles is determined by fir_len[1:0] , as shown in table 2 . 1.2.3 a/d converter (adc) a single delta - sigma a/d converter digitizes the voltage and current inputs to the 71m6531 d/f and 71m6532d/f . the resolution of the adc is programmable using the i/o ra m m40mhz and m26mhz bits (see table 2 ). the ce code must be tailored for use with the selected adc resolution. table 2 : adc resolution setting for [ m40mhz, m26mhz ] fir_len[1:0] ck 32 cycles fir ce cycles resolution [00], [10] or [11] 0 1 2 1 2 3 138 288 384 18 bits 21 bits 22 bits [01] 0 1 2 1 2 3 186 384 588 19 bits 22 bits 24 bits initiation of each adc conversion is controlled by mux_ctrl as described above. at the end of each adc conversion, the fir filter output data is stored into the ce ram l ocation determined by the mux selection. 1.2.4 fir filter the finite impulse response filte r is an integral part of the adc and it is optimized for use with the mult iplexer. the purpose of the fir filter is to decimate the adc output to the desir ed resolution. at the end of each adc conversion, the output data is stored into the fixed ce ram location determined by the multiplexer selection as shown in table 3 . fir data is stored lsb justified, but shifted left by eight bits. table 3 : adc ram locations address (hex) name address (hex) name 0x00 ia 0x09 aux 0x01 vb 0x0a temp 0x02 ib 0x0b vbat 0x03 va 1.2.5 voltage references the device includes an on - chip precision bandgap voltage reference that incorporates auto - zero tech niques. the reference is trimmed to minimize errors caused by component mismatch and dr ift. the re sult is a voltage output with a predictable temperature coefficient. the amplifier within the reference is chopper stabilized, i.e. the polarity can be switched by th e mpu us ing chop_e[1:0] ( ioram 0x2002[5:4 ]). the chop_e[1:0] field enable s the mpu to operate the chopper circuit in regula r or inverted operation, or in toggling mode. when the chopper circuit is toggled in between mul tiplexer cycles, dc offsets on the measured signals will automatically be averaged out. the general topology of a chopped amplifier is shown in figure 3 . downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 13 figure 3 : general topology of a chopped amplifier it is assumed that an offset voltage voff appears at the positiv e amplifier input. with all switches, as con trolled by cross, in the a position, the output voltage is: voutp C voutn = g (vinp + voff C vinn) = g (vinp C vinn) + g voff with all switches set to the b position by applying the inverted cross signal, the output voltage is: voutn C voutp = g (vinn C vinp + voff) = g (vinn C vin p) + g voff, or voutp C voutn = g (vinp C vinn) - g voff thus, when cross is toggled, e.g. after each multiplexer cycle, the off set will alternately appear on the output as positive and negative, which results in the offset effectively being eliminated, regardless of its polarity or magnitude. when cross is high, the connection of the amplifier input devices is reversed. this preserves the over all polarity of that amplifier gain; it inverts its input offset. by alternately reversing the connection, the am plifiers offset is averaged to zero. this removes the most significant long - term drift mechanism in the voltage reference. the chop_e[1:0] field control s the behavior of cross. the cross signal will reverse the amplifier connection in the voltage reference in order to negate the effects of its offset. on the first ck32 rising edge after the last multiplexer state of its sequence, the multi plexer will wait one additional ck32 cycle before beginning a new fram e. at the beginning of this cycle, the value of cross will be updated according to the chop_e[1:0] field . the extra ck32 cycle allows time for the chopped vref to settle. during this cycle, muxsync is held high. the leading edge of muxsync initiates a pass through the ce program sequence. the beginning of the sequence is the serial readout of the four rtm words. chop_e[1:0] has four states: positive, reverse and two toggle states. in the positive state, chop_e[1:0] = 01, cross and chop_clk are held l ow. in the reverse state, chop_e[1:0] = 10, cross and chop_clk are held high. in the first toggle state, chop_e[1:0] = 00, cross is automatically toggled near the end of each multiplexer frame and an alt frame is forced during the last multiplexer frame in each sum cycle. it is desirable that cross take on alternate values during each alt frame. for this reason, if chop_e[1:0] = 00, cross will not toggle at the end of the multiplexer frame im mediately preceding the alt frame in each accumulation interval . figure 4 : cross signal with chop_e[1:0] = 00 figure 4 s hows cross over two accumulation interval when chop_e[1:0] = 00: at the end of the first interval, cross is low, at the end of the second interval, cross is high. the offset error for the two temperature measurements taken during the alt multiplexer frames will be averaged to zero. note that g - + v inp v outp v outn v inn cross ab ab a b a b downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 14 rev 2 the number of multiplexer frames in an accumulation interval is always even. operation with chop_e[1:0] = 00 does not require control of the chopping mechanism by the mpu while elimi nating the offset for temperature measurement. in the second toggle state, chop_e[1:0] = 11, no alt frame is forced during the last multiplexer cycle in a n accumulation interval and cross always tog gles near the end of each multiplexer frame. the internal bias voltage , vbias (typically 1.6 v) , is used by the adc when measuring the temperature and battery monitor signals. 1.2.6 temperature sensor the 71m6531 d/f and 71m6532d/f include an on - chip temperature sensor implemented as a bandgap reference. it is used to determine the die temperature . the mpu may request an alternate multiplexer cycle containing the temperature sensor output by asserting mux_alt . the primary use of the temperature data is to determine the magnitude of compensation required to offset the thermal drift in the system (see section 3.4 temperature compensation ). 1.2.7 battery monitor the battery voltage is measured by the adc during alternative multiplexer frames if the bme (battery measure enable) bit in the i/o ram is set. while bme is set, an on - chip 45 k ? load resistor is applied to the battery and a scaled fraction of the battery voltage is applied to the adc input. after each alternative mux frame, the result of the adc conversion is available at xram addr ess 0x0b. bme is ignored and assumed zero when system power is not available (v1 < vbias). see section 5.4.4 battery monitor . 1.2.8 afe functional description the afe functions as a data acquisition system, controlled by the mpu. the main signals (ia, va, ib and vb ) are sampled , and the adc counts obtained are stored in xram where they can be accessed by the ce and, if necessary, by the mpu. alternate multiplexer cycles are initiated less frequently by the mpu to gather access to the slow temperature and battery signals. figure 5 shows the block diagram of the afe, with current inputs shown only as di fferential pair of pins (for the 71m6531d/f, the current input for phase a is a single pin [ia]). figure 5 : afe block diagram (shown for the 71m6532d/f) downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 15 1.3 d igital computation engine (ce) the ce, a dedicated 32 - bit signal processor, performs the precision computations necessary to acc urately measure energy. the ce calculations and processes include: ? multiplication of each current sample with its associated voltage sample to obtain the energy per sample (when multiplied with the constant sample time). ? frequency - insensiti ve delay cancellation on all four channels (to compensate for the delay bet ween samples caused by the multiplexing scheme). ? 90 phase shifter (for var calculations). ? pulse generation. ? monitoring of the input signal frequency (for frequency and phase information). ? monitoring of the input signal amplitude (for sag detection). ? scaling of the processed samples based on calibration coefficients. ? scal ing of all samples based on temperature compensation information ( 71m6532d/f only ). the ce program resides in flash memory. common access to flash memory by ce and mpu is controlled by a memory share circuit. each ce instruction word is two bytes long. allocated flash space for the ce program cannot exceed 4096 16 - bit words ( 8 kb). the ce program counter begins a pass through the ce code each time multiplexer state 0 begins. the code pass ends when a halt instruction is executed. for proper operation, the code pass must be completed before the multiplexer cycl e ends (see section 2.2 system timing summary ). the ce program must begin on a 1 - kb boundary of the flash address. the i/o ram register ce_lctn [7 :0] defines which 1 - kb boundary contains the ce code. thus, the first ce instruction is located at 1024* ce_lctn[7 :0]. the ce can access up to 4 kb of data ram (xram) , or 1024 32 - bit data words, starting at ram address 0x0000. the xram can be accessed by the fir filter block, the rtm circuit, t he ce, and the mpu. assigned time slots are reserved for fir, and mpu, respectively, to prevent bus content ion for xram data access. the mpu can read and write the xram as the primary means of data communication between the two processors. table 4 shows the ce addresses in xram allocated to analog inputs from the afe. table 4 : xram locations for adc results address (hex) name description 0x00 ia phase a current 0x01 va phase a voltage 0x02 ib phase b current 0x03 vb phase b voltage 0x04...0x0 9 C not used 0x0a temp temperature 0x0b vbat battery voltage the ce is aided by support hardware to facilitate implementatio n of equations, pulse counters and accumulators. this hardware is controlled through i/o ram locations equ[2:0] (equation assist), the dio_pv and dio_pw (pulse count assist) bits and pre_samps[1:0] and sum_cycles[5:0] (accumulation assist). pre_samps[1:0] and sum_cycles [5:0] support a dual level accumulation scheme where the first accumulator accumulates results from pre_samps[1:0] samples and the second accumulator accumulates up to sum_cycles [5:0] of the first accumulator results. the integration time for each energy outp ut is pre_samps[1:0] * sum_cycles [5:0] /2520.6 (with mux_div[3:0] = 1). the ce hardware issues the xfer_busy interrupt when the accumulation is complete. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 16 rev 2 1.3.1 meter equations the 71m6531 d/f and 71m6532d/f provide hardware assistance to the ce in order to support various meter equations. this assistance is controlled through i/o ram location equ[2:0] (equation assist). the compute engine (ce) firmware for residential configurations implements the equati ons listed in table 5 . equ[2:0] specifies the equation to be used based on the number of phases used for metering. table 5 : meter equations equ[2:0] description watt and var formula mux sequence alt mux sequence element 0 element 1 element 2 0 1 element, 2 w, 1 with neutral current sense va ? ia va ? ib n/a sequence is programmable with slotn_sel [3:0] sequence is programmable with slotn_alt sel [3:0] 1 1 element, 3 w, 1 va(ia - ib)/2 n/a n/a 2 2 element, 3 w, 3 delta va ? ia vb ? ib n/a not all ce codes support all equations. 1.3.2 real - time monitor the ce contains a real - time monitor (rtm), which can be programmed to monitor four selectable xr am locations at full sample rate. the four monitored locations are serially output to the tmuxout pin via the digital output multiplexer at the beginning of each ce code pass. the rt m can be enabled and disabled wi th the rtm_e bit . the rtm output is clocked by cktest (pin seg19/cktest), with the clock output enabled by setting ckout_e = 1 . each rtm word is clocked out in 35 cycles and contains a leading flag bit. see figure 20 for the rtm output format. rtm is low when not in use. 1.3.3 pulse generator s the 71m6531 d/f and 71m6532d/f provide four pulse generators, rpulse, wpulse, xpulse and ypulse, as well as increased hardware support for the two original pulse generators (rpulse and wpulse) . the pulse generators can be used to output ce status indicators, sag for example , to dio pins. the polarity of the pulses may be inverted with the pls_inv bit . when this bit is set, the pulses are active high, rather than the more usual active low. pls_inv inverts all the pulse outputs. xpulse and ypulse pulses generated by the ce may be exported to the xpulse and ypulse pul se outputs. pins dio8 and dio9 are used for these pulses. generally, the xpulse and ypulse ou tputs are updated once on each pass of the ce code, resulting in a pulse frequency up to a maximum of 1260hz (assuming a mux frame is 13 ck32 cycles). the ypu lse pin can be used by the ce code to generate interrupts based on sag events. this method is faster than checking the sag bits by the mpu at every ce_busy interrupt. see section 4.3.6 ce status and control for details. rpulse and wpulse during each ce code pass, the hardware stores exported wpul se and rpulse sign bits in an 8 - bit fifo and outputs them at a specified interval. this permits the ce code to calculate the rpulse and wpulse outputs at the beginning of it s code pass and to rely on hardware to spread them ove r the mux frame. the fifo is reset at the beginning of each mux frame. the pls_interval register controls the delay to the first pulse update and the interval between subsequent updates. its lsb is 4 ck_fir cycles. if zero, the fifo is deactivated and the dffs are updated immediately. thus, n interval is 4 * pls_interval . downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 17 since the fifo resets at the beginning of each mux frame, the user must spec ify pls_interva l so that all of the pulse updates are output before the mux frame completes. for instance, if the ce code outputs 5 updates per mux interval and if the mux interval is 1950 cycles long, the ideal value for the interva l is 1950/5/4 = 97.5. if pls_interval = 98, the fifth output will occur too late and be lost . in this case, the proper value for pls_interval is 97. hardware also provides a maximum pulse width feature. the pls_maxwidth register s elects a maxi mum negative pulse width to be nmax updates according to the formula: nmax = (2* pls_maxwidth +1). if pls_maxwidth = 255, no width checking is performed. the wpulse and rpulse pulse generator outputs are available on dio6 and dio 7, respectively. they can also be output on opt_tx (see opt_txe[1:0] for details). 1.3.4 data ram (xram) t he ce and mpu use a singl e general - purpose data ram (also referred to as xram) . the data ram is 1024 32 - bit words, sh ared between the ce and the mpu using a time - multiplex method. this reduces mpu wait states when accessing ce data. when the mpu and ce are clocking at maximum frequency (10 mhz), the dram will make up to four accesses during each 100 ns interval. these consist of two mpu accesses, one ce access and one spi access. the data ram is 32 bits wide and uses an external multiplexer so as to appear byt e - wide to the mpu. the data ram hardware will convert an mpu byte write operation into a read - modify - write operation that requires two data ram accesses. the second access is guaranteed to be available because the mpu cannot access the xram on two consecutive instructions unless it is usin g the same address. in addition to the reduction of wait states, this arrangement permits the m pu to easily use unneeded ce data memory. likewise, the amount of memory the ce uses is not limited by the size of a dedicated ce data ram. 1.3.5 delay compensation when measuring the energy of a phase (i.e., wh and varh) in a service, the vol tage and current for that phase must be sampled at the same i nstant. otherwise, the phase difference, , introduces errors. o delay o delay f t t t 360 360 ? ? = ? = where f is the frequency of the input signal and t delay is the sampling delay between voltage and current. in t raditional meter ics, sampling is accomplished by using two a/d converters per phase (one for volt age and the other one for current) controlled to sample simultaneously. the patented single - converter tec h- nology ? , however, ex ploits the 32 - bit signal processing capability of its ce to implement constant delay all - pass filters. the se all - pass filter s correct for the conversion time difference between the voltage and the corresponding current samples that are obtained with a single multiplexed a/ d converter. the constant delay all - pass filter s provide a broad -b and delay , that is precisely matched to the differ - ence in sample time between the voltage and the current of a given phase. this di gital filter does not a f- fect the amplitude of the signal, but provides a precisely controlled phase res ponse. the delay compen- sation implemented in the ce aligns the voltage samples with their correspond ing current samples by routing the voltage samples through the all - pass filter, thus delaying the voltage samples by , resulting in the residual phase error C . the residual phase error is negligible, and is typically less than 1.5 milli - degrees at 100hz, thus it does not contribute to errors in the energy measurements. 1.3.6 ce functional overview the adc processes one sample per channel per multiplexer cycle. figure 6 shows the timing of the samples taken during one multiplexer cycle. the number of samples processed during one accumulation cycle is controlled by pre_samps[1:0] ( ioram 0x2001[7:6] ) and sum_cycles [5:0] ( ioram 0x2001[5:0] ). the integration time for each energy output is : pre_samps[1:0] * sum_cycles[5:0] / 2520.6, where 2520.6 is the sample rate [hz] downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 18 rev 2 for example, pre_samps[1:0] = 42 and sum_cycles[5:0] = 50 will establish 2100 samples per accumulation cycle. pre_samps[1:0] = 100 and sum_cycles[5:0] = 21 will result in the exact same accumulation cycle of 2100 samples or 833 ms. after an accumulation cycle is completed, the xfer_busy int errupt signals to the mpu that accumulated data are available. figure 6 : samples from multiplexer cycle the end of each multiplexer cycle is signaled to the mpu by the ce_bus y interrupt. at th e end of each multiplexer cycle sta tus information, such as sag data and the digitized input signal, i s available to the mpu. figure 7 : accumulation interval figure 7 shows the accumulation interval resulting from pre_samps[1:0] = 42 and sum_cycles[5:0] = 50, consisting of 2100 samples of 397 s each, followed by the xfer_busy interrupt. the sampling in t his example is applied to a 50 hz signal. there is no correlation between the line signal frequency and the choice of pre_samps[1:0] or sum_cycles[5:0] ( even though when sum_cycles[5:0] = 42 one set of sum_cycles[5:0] happens to sample a period of 16.6 ms) . furthermore, sampling does not have to start when the line voltage crosses the zero line and the length of the accumulation interval need not be an integer multiple of t he signal cycles. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 19 1.4 80515 mpu core the 71m6531 d/f and 71m6532d/f inc lude an 80515 mpu (8 - bit, 8051 - compatible) that processes most in structions in one clock cycle. using a 10 - mhz clock results in a processing throughput of 10 mips. the 80515 architecture eliminates redundant bus states and implements parallel execution of fetch and execu tion phases. normally , a machine cycle is aligned with a memory fetch, there fore, most of the 1 - byte in structions are performed in a single machine cycle (mpu clock cycle) . this leads to an 8x average p erformance im prove ment (in terms of mips) over the intel ? 8051 device running at the same clock frequency . table 6 shows the ckmpu frequency as a function of the allowed combinations of the mpu clock divider mpu_div[2:0] and the mck divider bits m40mhz and m26mhz . actual processor clocking speed can be adjusted to the total processing demand of the application (metering calculations, am r manage ment, memory management, lcd driver management and i/o management) using the i/o ram field mpu_div[2:0] and the mck divider bits m40mhz and m26mhz , as shown in table 6 . table 6 : ckmpu clock frequencies mpu_div [2:0] [ m40mhz, m26mhz ] values [1,0] [0,1] [0,0] 000 9.8304 mhz 6.5536 mhz 4.9152 mhz 001 4.9152 mhz 3.2768 mhz 2.4576 mhz 010 2.4576 mhz 1.6384 mhz 1.2288 mhz 011 1.2288 mhz 819.2 khz 614.4 khz 100 614.4 khz 409.6 khz 307.2 khz 101 307.2 khz 204.8 khz 153.6 khz 110 153.6 khz 102.4 khz 76.80 khz 111 153.6 khz 102.4 khz 76.8 khz typical measurement and metering functions based on the results provided by the internal 32 - bit com pute engine (ce) are available for the mpu as part of maxims standard library. maxim provides demonstration source code to help reduce the design cycle. 1.4.1 memory organization and addressin g the 80515 mpu core incorporates the harvard architecture with separate code and data spaces. memory organization in the 80515 is similar to that of the industry standard 8051 . there are four memory areas: program memory (flash, shared by mpu and ce), external ram (data ram, shared by the ce and mpu, configuration or i/o ram ), and internal data memory (internal ram) . table 7 shows the memory map. p rogram memory the 80515 can address up to 64 kb of program memory space from 0x0000 to 0xff ff. program memory is read when the mpu fetches instructions or performs a movc operation. ac cess to program memory above 0x7fff is controlled by the fl_bank[2:0] register (sfr 0xb6). after reset, the mpu starts program execution from program memory locati on 0x0000. the lower part of the program memory includes reset and interrupt vectors. the interrupt vectors are spaced at 8 - byte in tervals, starting from 0x0003 . mpu external data memory (xram) both internal and external memory is physically located on the 71m6531 device . the e x ternal memory referred to in this documentation is only external to the 80515 mpu core. 4 kb of ram starting at address 0x0000 is shared by the ce and mpu. the ce normally uses the first 1 kb, leaving 3 kb for the mpu. different versions of the ce code use var ying amounts. consult the documentation for the specific code version being used for the exact limit. if the mpu overwrite s the ces working ram, the ces output may be corrupted. if the ce is disabled, the first 0x40 bytes of ram are still unusable while mux_div[3:0] 0 because the 71m6531 adc writes to these locations. setting mux_div[3:0] = 0 disables the adc output preventing the ce from writing the first 0x40 bytes of ram. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 20 rev 2 the 80515 writes into external data memory when the mpu executes a movx @ri,a or movx @dptr,a instruction. the mpu reads external data memory by executing a movx a,@ri or movx a,@dptr instruction (sfr pdata provides the upper 8 bytes for the movx a,@ri instruction). internal and external memory map table 7 shows the address, type, use and size of the various memory components. only the memory ranges shown in table 7 contain physical memory. table 7 : memory map address (hex) memory technology memory type name typical usage memory size (bytes) 00000 - 1ffff/ 00000 - 3ffff flash memory non - volatile program memory for mpu and ce mpu program and non - volatile data 128 kb/ 256 kb ? ce program (on 1 kb boundary) 8 kb max. 0000 - 0fff static ram volatile external ram (xram) shared by ce and mpu 4 kb 2000 - 20bf, 20c8 - 20ff static ram volatile configuration ram, i/o ram hardware control 256 20c0 - 20c7 static ram non - volatile (battery) configuration ram, i/o ram battery - buffered memory 8 0000 - 00ff static ram volatile internal ram part of 80515 core 256 ? memory size depends on the ic. see section 1.5.5 physical memory for details. movx addressing ther e are two types of instructions differing in whether they provide an 8- bit or 16 - bit indirect address to the external data ram. in the first type, movx a ,@r i , the contents of r0 or r1 in the current register bank provide the eight lower - ordered bits of address . the eight high - ordered bits of the address are specified with the pdata sfr . this method allows the user paged access (256 pages of 256 bytes each) to all ran ges of the external data ram . in the second type of movx instruction , movx a,@dptr , the data pointer generates a 16 - bit address . this form is faster and more efficient when accessing very large data arrays (up to 64 kb ), since no additional instructions are needed to set up the eight high ordered bits of the address. it is possible to mix the two movx types . this provides the user with four separate data pointers, two with direct access and two with paged access , to the entire 64 kb of external memory range. dual data pointer the dual data pointer accelerates the block moves of data . the standard dptr is a 16 - bit register that is used to address external memory or peripherals . in the 80515 core, the standard data pointer is called dptr , the second data pointer is called dptr1 . the data pointer select bit , located in the lsb of the dps register ( dps [0] ), chooses the active pointer . dptr is selected when dps [0] = 0 and dptr1 is selected when dps [0] = 1. the user switches between pointers by toggling the lsb of the dps register . the values in the data pointers are not affected by the lsb of the dps register . all dptr related instructions use the currently selected dptr for any activity. the second data pointer may not be supported by certain compilers. dptr1 is useful for copy routines, where it can make the inner loop of the routine two instructions fast er compared to the reloading of dptr from registers . any interrupt routine using dptr1 must save and r estore dps , dptr and dptr1 , which increases stack usage and slows down interrupt latency. by selecting the evatronics r80515 core in the keil compiler project settings and by using the compiler directive modc2, dual data pointers are enabled in certain library routines. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 21 an alternative data pointer is available in the form of the pdata register (sfr 0xbf ) , sometimes referred to as usr2 ) . it defines the high byte of a 16 - bit address when reading or writing xdata with the instruction movx a,@ri or movx @ri,a. internal data memory map and access the internal data memory provides 256 bytes (0x00 to 0xff) of data memory . the internal data memory address is always 1 byte wide . table 8 shows the internal data memory map. the special function registers (sfr) occupy the upper 128 bytes. t he sfr area of internal data memory is available only by direct addressing. indirect addressing of this ar ea accesses the upper 128 bytes of internal ram . the lower 128 bytes contain working registers and bit addressable memory . the lower 32 bytes form four banks of eight registers (r0 - r7) . two bits on the program memory status word ( psw ) select which bank is in use . the ne xt 16 bytes form a block of bit addressabl e memory space at bit addresses 0x00 - 0x7f . all of the bytes in the lower 128 bytes are accessible through direct or indirect addressing . table 8 : internal data memory map address range direct add ressing indirect addressing 0x80 0xff special function registers (sfrs) ram 0x30 0x7f byte addressable area 0x20 0x2f bit addressable area 0x00 0x1f register banks r0r7 1.4.2 special function registers (sfrs) a map of the special function registers is shown in table 9. only a few addresses in the sfr memory space are occupied, the others are not im plemente d. a read access to unimplemented addresses will return undefined data, while a write access will have no effect. sfrs specific to the 71m6531 d/ f and 71m6532d/f are shown in bold print on a gray field . the registers at 0x80, 0x88, 0x90, etc., are bit ad dressable, all others are byte addressable. see the restrictions for the intbits register in table 14 . table 9 : special function register map hex/ bin bit addressable byte addressable bin/ hex x000 x001 x010 x011 x100 x101 x110 x111 f8 intbits ff f0 b f7 e8 iflags ef e0 a e7 d8 wdcon df d0 psw d7 c8 t2con cf c0 ircon c7 b8 ien1 ip1 s0relh s1relh pdata bf b0 p3 flshctl fl_bank pgadr b7 a8 ien0 ip0 s0rell af a0 p2 dir2 dir0 a7 98 s0con s0buf ien2 s1con s1buf s1rell eedata eectrl 9f 90 p1 dir1 dps erase 97 88 tcon tmod tl0 tl1 th0 th1 ckcon 8f 80 p0 sp dpl dph dpl1 dph1 pcon 87 downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 22 rev 2 1.4.3 generic 80515 special function registers table 10 shows the location, description and reset or power - up value of the generic 80515 sfrs . additional descriptions of the registers can be found at the page numbers listed in the table. table 10 : generic 80515 sfrs - location and reset values name address (hex) reset value (hex) description page p0 0x80 0xff port 0 24 sp 0x81 0x07 stack pointer 23 dpl 0x82 0x00 data pointer low 0 23 dph 0x83 0x00 data pointer high 0 23 dpl1 0x84 0x00 data pointer low 1 23 dph1 0x85 0x00 data pointer high 1 23 pcon 0x87 0x00 uart speed control , idle and stop mode control 28 tcon 0x88 0x00 timer/counter control 31 tmod 0x89 0x00 timer mode control 29 tl0 0x8a 0x00 timer 0, low byte 28 tl1 0x8b 0x00 timer 1, high byte 28 th0 0x8c 0x00 timer 0, low byte 28 th1 0x8d 0x00 timer 1, high byte 28 ckcon 0x8e 0x01 clock control (stretch=1) 24 p1 0x90 0xff port 1 23 dps 0x92 0x00 data pointer select register 20 s0con 0x98 0x00 serial port 0, control register 27 s0buf 0x99 0x00 serial port 0, data buffer 26 ien2 0x9a 0x00 interrupt enable register 2 31 s1con 0x9b 0x00 serial port 1, control register 27 s1buf 0x9c 0x00 serial port 1, data buffer 26 s1rell 0x9d 0x00 serial port 1, reload register, low byte 26 p2 0xa0 0xff port 2 23 ien0 0xa8 0x00 interrupt enable register 0 30 ip0 0xa9 0x00 interrupt priority register 0 33 s0rell 0xaa 0xd9 serial port 0, reload register, low byte 26 p3 0xb0 0xff port 3 23 ien1 0xb8 0x00 interrupt enable register 1 31 ip1 0xb9 0x00 interrupt priority register 1 33 s0relh 0xba 0x03 serial port 0, reload register, high byte 26 s1relh 0xbb 0x03 serial port 1, reload register, high byte 26 pdata 0xbf 0x00 high address byte for movx@ri - also called usr2 20 ircon 0xc0 0x00 interrupt request control register 31 t2con 0xc8 0x00 polarity for int2 and int3 31 psw 0xd0 0x00 program status word 23 wdcon 0xd8 0x00 baud rate control register (only wdcon[ 7] bit used) 26 a 0xe0 0x00 accumulator 23 b 0xf0 0x00 b register 23 downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 23 accumulator ( acc , a , sfr 0xe0 ): acc is the accumulator register . most instructions use the accumulator to hold the operand . the mne monics for accumulator - specific instructions refer to accumulator as a , not acc . b register ( sfr 0xf0 ) : the b register is used during multiply and divide instructions . it can also be used as a scratch - pad register to hold temporary data. program status word ( psw , sfr 0xd0 ): this register contains various flags and control bits for the selection of the register banks (see table 11 ). table 11 : psw bit functions ( sfr 0xd0 ) psw bit symbol function 7 cv carry flag . 6 ac auxiliary carry flag for bcd operations . 5 f0 general - purpose flag 0 available for user. f0 is not to be confused with the f0 flag in the cestatus register. 4 rs1 register bank select control bits . the contents of rs1 and rs0 select the working register bank: rs1/rs0 bank selected location 00 bank 0 0x00 C 0x07 01 bank 1 0x08 C 0x0f 10 bank 2 0x10 C 0x17 11 bank 3 0x18 C 0x1f 3 rs0 2 ov overflow flag . 1 - user defined flag . 0 p parity flag, affecte d by hardware to indicate odd or even number of one bits in the accumulator, i.e. even parity. s tack pointer ( sp , sfr 0x81 ) : the stack pointer is a 1 - byte register initialized to 0x07 after reset . this register is incremented before push and call instructions, causing the stack to begin at location 0x08. data pointer: the data pointer s ( dptr and d prt1 ) are 2 bytes wide . the lower part is dpl (sfr 0x82) and dpl1 (sfr0x84) and the highest is dph (sfr0x83) and dph1 (sfr 0x85) . the data pointers can be loaded as two registers (e.g. mov dpl,#data8) . t hey are generally used to access external code or data space (e.g. movc a,@a+dptr or movx a,@dptr respectively). program counter: the program counter ( pc ) is 2 bytes wide and initialized to 0x0000 after reset . the pc is incremented when fetching operation code or when operating on data from program memory . port registers: the i/o ports are controlled by special function registers p0 , p1 and p2 as shown in table 12 . the contents of the sfr can be observed on corresponding pins on the chip . writing a 1 to any of the ports causes the corresponding pin to be at high level (v3p3). writing a 0 causes the corresponding pin to be held at a low level (gnd) . the data direction registers dir0 , dir1 and dir2 define individual pins as input or output pins (see section s 1.5.7 digital i/o C 71m6531d/f or 1.5.8 digital i/o C 71m6532d/f ). downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 24 rev 2 table 12 : port registers register sfr addr ess r/w description p0 0x80 r/w register for port 0 read and write operations . dir0 0xa2 r/w data direction register for port 0 . setting a bit to 1 indicates that the corresponding pin is an output. p1 0x90 r/w register for port 1 read and write operations . dir1 0x91 r/w data direction register for port 1. p2 0xa0 r/w register for port 2 read and write operations . dir2 0xa1 r/w data direction register for port 2. all dio ports on the chip are bi - directional . each of them consists of a latch (sfr p0 to p2 ), an output driver and an input buffer, therefore the mpu can output or read data through any of thes e ports . even if a dio pin is configured as an output, the state of the pin can still be read by the mpu, for exam ple when counting pulses issued via dio pins that are under ce control. the technique of reading the status of or generating interrupts based on dio pins configured as outputs can be used to implement pulse counting . clock stretching ( ckcon [2:0], sfr 0x8e ) the ckcon [2:0] field define s the stretch memory cycles that could be used for movx instructions when access ing slow external peripherals. the practical value of this register for the 71m653x is to guarantee access to xram between ce, mpu, and spi. the default setting of ckcon [2:0] (001) should not be changed.table 13 shows how the signals of the external memory interface change when stretc h va lues are set from 0 to 7. the widths of the signals are counted in mpu clock c ycles. the post - reset state of the ckcon [2:0] field (001) , which is shown in bold in the table, performs the movx instructions with a stretch value equal to 1. table 13 : stretch memory cycle width ckcon[2:0] stretch value read signal width write signal width memaddr memrd memaddr memwr 000 0 1 1 2 1 001 1 2 2 3 1 010 2 3 3 4 2 011 3 4 4 5 3 100 4 5 5 6 4 101 5 6 6 7 5 110 6 7 7 8 6 111 7 8 8 9 7 1.4.4 special function registers (sfrs) specific to the 71m6531d/f and 71m6532d/f table 14 shows the location and description of the sfrs sp ecific to the 71m6531 d/ f and 71m6532d/f . table 14 : 71m6531d/f and 71m6532d/f specific sfrs register (alternate name) sfr add ress bit field name r/w description eedata 0x9e r/w i 2 c eeprom interface data register. eectrl 0x9f r/w i 2 c eeprom interface control register. see section 1.5.14 eeprom interface for a descrip tion of the command and status bits available for eectr l . downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 25 register (alternate name) sfr add ress bit field name r/w description erase (flsh_erase) 0x94 w this register is used to initiate either the flash mass erase cycle or the flash page erase cycle. see the flash memory section for details. fl_bank 0xb6[2:0] r/w flash bank selection. pgaddr (flsh_pgadr [5:0] ) 0xb7 r/w flash page erase address register. contains the flash memory page address (page 0 through page 127) that will be erased during the page erase cycle (default = 0x00) . must be re - written for each new page erase cycle. flshcrl 0xb2[0] flsh_pwe r/w program write enable: 0: movx commands refer to xram space, normal operation (default). 1: movx @dptr,a moves a to program space (flash) @ dptr. 0xb2[1] flsh_meen w mass erase enable: 0: mass erase disabled (default). 1: mass erase enabled. must be re - written for each new mass erase cycle. 0xb2[6] secure r/w enables security provisions that prevent external reading of flash memory and ce program ram. this bit is reset on chip reset and may only be set. attempts to write zero are ignored. 0xb2[7] preboot r indicates that the preboot sequence is active. iflags 0xe8[0] ie_xfer r/w this flag monitors the xfer_busy interrupt. it is set by hardware and must be cleared by the in terrupt handler. 0xe8[1] ie_rtc r/w this flag monitors the rtc_1sec inter rupt. it is set by the hardware and must be cleared by the in terrupt handler. 0xe8[2] fwcol 1 r/w this flag indicates that a flash write was in progress while the ce was busy. 0xe8[3] fwcol 0 r/w this flag indicates that a flash write was attempted when the ce was attempting to be gin a code pass. 0xe8[4] ie_pb r/w this flag indicates that the wake - up pushbutton was pressed. 0xe8[5] ie_wake r/w this flag indicates that the mpu was awakened by the autowake timer. 0xe8[6] pll_rise r/w pll_rise interrupt flag: write 0 to clear the pll_rise interrupt flag . 0xe8[7] pll_fall r/w pll_fall interrupt flag: write 0 to c lear the pll_fall interrupt flag . intbits ( int0 int6 ) 0xf8[6:0] int6 int0 r interrupt inputs. the mpu may read these bits to see the status of external interrupts int0 up to int6 . these bits do not have any memory and are primarily intended for debug use. 0xf8[7] wd_rst w the wdt is reset when a 1 is written to this bit. only byte operations on the entire intbits register should be used when writing. the byte must have all bits set except the bits that are to be cleared. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 26 rev 2 1.4.5 instruction set all instructions of the generic 8051 microcontroller are supported . a complete list of the instruction set and of the associated op - codes is contained in the 71m653 x software users guide (sug) . 1.4.6 uarts the 71m6531 d/ f and 71m6532d/f include a uart (uart0) that can be programmed to communicate with a variety of amr modules . a second uart (uart1) is connected to the optical port, as described in section 1.5.6 optical interface . the uarts are dedicated 2 - wire serial interfaces, which can communicate with an external host pro cessor at up to 38,400 bits/s (with mpu clock = 1.2288 mhz) . the operation of the rx and tx uart0 pins is as follows: ? uart0 rx: serial input data are applied at this pin . conforming to rs - 232 standard, the bytes are input lsb first. ? uart0 tx : this pin is used to output the serial data . the bytes are output lsb first. the 71m6531 d/ f and 71m6532d/f ha ve several uart - related registers for the control and buffering of serial data . a single sfr register serves as both the transmit buffer and receive buf fer ( s0buf, sfr 0x99 for uart0 and s1buf, sfr 0x9c for uar t1). when written by the mpu, s0buf and s1 buf act as transmit buffers for their respective channels, and when read by the mpu, t hey act as receive buffer s . writing data to the transmit buffer starts the transmission by the associated uart. received data are available by reading from the receive buffer. both uarts can simultaneously transmit and receive data. wdcon [7] ( sfr 0xd8 ) selects whether timer 1 or the internal baud rate generator is used . all uart transfers are pro grammable for parity enable, parity, 2 stop bits/1 stop bit and xon/xoff options for variable communication baud rates from 300 to 38400 bps . table 15 shows how the baud rates are calculated . table 16 shows the selectable uart operation modes. table 15 : baud rate generation using timer 1 ( wdcon [7] = 0) using internal baud rate generator ( wdcon [7] = 1) uart0 2 smod * f ckmpu / (384 * (256 - th1 )) 2 smod * f ckmpu /(64 * (2 10 - s0rel )) uart1 n/a f ckmpu /(32 * (2 10 - s1rel )) s0rel and s1rel are 10 - bit values derived by combining bits from the respective timer reload r egisters ( s0rell, s0relh, s1rell, s1relh ) . smod is the smod bit in the sfr pcon register . th1 is the high byte of timer 1. table 16 : uart modes uart 0 uart 1 mode 0 n/a start bit, 8 data bits, parity, stop bit, variable baud rate (internal baud rate generator) mode 1 start bit, 8 data bits, stop bit, variable baud rate (internal baud rate generator or timer 1) start bit, 8 data bits, stop bit, variable baud rate (internal baud rate generator) mode 2 start bit, 8 data bits, parity, stop bit, fixed baud rate 1/32 or 1/64 of f ckmpu n/a mode 3 start bit, 8 data bits, parity, stop bit, va r- iable baud rate (internal baud rate ge n- erator or timer 1) n/a parity of serial data is available through the p flag of the accumulator . 7- bit serial modes with parity, such as those used by the flag protocol, can be simulated by setting and reading bit 7 of 8- bit output data . 7- bit serial modes without parity can be simulated by setting bit 7 to a constant 1 . 8- bit serial modes with parity can be simulated by setting and reading the 9 th bit, using the control bits tb80 ( s0con [ 3 ] ) and tb81 ( s1con [3] ) in the s0co n ( sfr 0x98 ) and s1con ( sfr 0x9b) sfrs for transmit and rb81 ( s1con [2] ) for receive operations . downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 27 the feature of receiving 9 bits (mode 3 for uart0, mode a for uart1) c an be used as handshake signals for inter - processor communication in multi - processor systems. in this case, the slave processors have bit sm20 ( s0con[5] ) for uart0, or sm21 ( s1con[5] for uart1, set to 1. when the master processor outputs the slaves address, it sets the 9 th bit to 1, causing a serial port receive interrupt in all the slav es. the slave processors compare the received byte with their address. if there is a mat ch, the addre ssed slave will clear sm20 or sm21 and receive the rest of the message. all other slaves will ignore the mes sage. after addressing the slave, the host outputs the rest of the message with the 9 th bit set to 0, so no additional serial port receive interrupts will be generated. uart control registers: the function s of uart0 and uart1 depend on the setting of the serial port control register s s0con and s1con shown in table 17 and table 18 , respectively and the pcon register shown in table 19 . since the ti0, ri0, ti1 and ri1 bits are in an sfr bit addressable byt e, common practice would be to clear them with a bit operation, but t his must be avoided . the hardware implements bit operations as a byte wide read - modify - write hardware macro. if an interrupt occurs after the read, but before the write, its flag will be cleared unintentionally. the proper way to clear these flag bits is to write a byte mask consisting of all ones except for a zero in the location of the bit to be cleared. the flag bits are configured in hardware to ignore ones written to them. table 17 : the s0con (uart0) register (sfr 0x98) bit symbol function s0con [7] sm0 the sm0 and sm1 bits set the uart0 mode: mode description sm0 sm1 0 n/a 0 0 1 8- bit uart 0 1 2 9- bit uart 1 0 3 9- bit uart 1 1 s0con [6] sm1 s0con [5] sm20 enables the inter - processor communication feature. s0con [4] ren0 if set, enables serial reception . cleared by software to disable reception. s0con[3] tb80 the 9th transmitted data bit in modes 2 and 3. set or cleared by the mpu, depending on the function it performs (parity check, multiprocessor communication et c.) s0con[2] rb80 in modes 2 and 3 it is the 9 th data bit received. in mode 1, sm20 is 0, rb80 is the stop bit. in mode 0, this bit is not used. must be cleared by software. s0con[1] ti0 transmit interrupt flag; set by hardware after completion of a serial transfer. must be cleared by software. s0con[0] ri0 receive interrupt flag; set by hardware after completion of a serial reception. must be cleared by software. table 18 : the s1con (uart1) register (sfr 0x9b) bit symbol function s1con [7] sm sets the baud rate and mode for uart1. sm mode description baud rate 0 a 9- bit uart variable 1 b 8- bit uart variable s1con [5] sm21 enables the inter - processor communication feature. s1con [4] ren1 if set, enables serial reception . cleared by software to disable reception. s1con [3] tb81 the 9 th transmitted data bit in mode a . set or cleared by the mpu, depending on the function it performs (parity check, multiprocessor communication etc.) downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 28 rev 2 bit symbol function s1con [2] rb81 in modes a and b, it is the 9 th data bit received . in mode b, if sm21 is 0, rb81 is the stop bit . must be cleared by software s1con [1] ti1 transmit interrupt flag, set by hardware after completion of a serial transfer . must be cleared by software. s1con [0] ri1 receive interrupt flag, set by hardware after completion of a serial reception . must be cleared by software . table 19 : pcon register bit description (sfr 0x87) bit symbol function pcon[7] smod the smod bit doubles the baud rate when set pcon[6:2 ] C not used. pcon[1 ] stop stops mpu flash access and mpu peripherals including timers and uarts when set until an external interrupt is received. pcon[0 ] idle stops mpu flash access when set until an internal interrupt is received. 1.4.7 timers and counters the 80515 has two 16 - bit timer/counter registers: timer 0 and timer 1 . these registers can be con figured for counter or timer operations. in timer mode, the register is incremented every 12 mpu clock cycle s. in counter mode, the register is incremented when the falling edge is observed at the corresponding input signal t0 or t 1 (t0 and t1 are the timer gating inputs derived from certain dio pins, see section 1.5.7 digital i/o ) . since it takes 2 machine cycles to recognize a 1 - to - 0 event, the maximum input count rate is 1/2 of the clock frequency (ckmpu). there are no restrictions on the duty cycle, however to ensure proper recognit ion of the 0 or 1 state, an input should be stable for at least 1 machine cycle. four operating modes can be selected for timer 0 and timer 1, as shown in table 20 and table 21 . the tmod register, shown in table 22 , is used to select the appropriate mode. the timer/counter operation is controlled by the tcon reg ister, which is shown in table 23 . bits tr1 ( tcon [6] ) and tr0 ( tcon [4] ) in the tcon register start their associated timers when set. table 20 : timers/counters mode description m1 m0 mode function 0 0 mode 0 13 - bit counter/timer mode with 5 lower bits in the tl0 or tl1 register and the remaining 8 bits in the th0 or th1 register (for timer 0 and timer 1, respectively) . the 3 high order bits of tl0 and tl1 are held at zero. 0 1 mode 1 16 - bit counter/timer mode . 1 0 mode 2 8- bit auto - reload counter/timer . the reload value is kept in th0 or th1 , while tl0 or tl1 is incremented every machine cycle . when tl( x) overflows, a value from th( x) is copied to tl (x) (where x = 0 for coun ter/timer 0 or 1 for counter/timer 1 . 1 1 mode 3 if timer 1 m1 and m0 bits are set to 1, timer 1 stops. if timer 0 m1 and m0 bits are set to 1, timer 0 acts as two independent 8- bit timer/counters. in mode 3, tl0 is affected by tr0 and gate control bits and sets the tf0 flag on overflow, while th0 is affected by the tr1 bit and the tf1 flag is set on overflow. table 21 specifies the combinations of operation modes allowed for timer 0 and timer 1. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 29 table 21 : allowed timer /counter mode combinations timer 1 mode 0 mode 1 mode 2 timer 0 - mode 0 yes yes yes timer 0 - mode 1 yes yes yes timer 0 - mode 2 not allowed not allowed yes table 22 : tmod register bit description (sfr 0x89) bit symbol function timer/counter 1 : tmod[7] gate if tmod[7] is set, external input signal control is enabled for counter 0. external gate control . the tr 1 bit in the tcon register (sfr 0x88) must al so be set in order for counter 1 to increment. w ith these settings c ounter 1 is incremented on every falling edge o f the logic signal applied to one or more of the i n terrupt sources controlled by the di_rbp , dio_r1 , dio_rxx registers. tmod[6] c/t selects timer or counter operation. when set to 1, a counter operation is per formed. when cleared to 0, the corresponding register will funct ion as a timer. tmod[5:4] m1:m0 selects the mode for timer/counter 1 as shown in table 20 . timer/counter 0: tmod[3] gate if tmod[3 ] is set, external input signal control is enabled for counter 0. external gate control . the tr0 bit in the tcon register (sfr 0x88) must also be set in order for counter 0 to increment. w ith these settings c ounter 0 is incremented on every falling edge o f the logic signal applied to one or more of the i n terrupt sources controlled by the di_rbp , dio_r1 , dio_rxx registers. tmod[2] c/t selects timer or counter operation. when set to 1, a c ounter operation is performed. when cleared to 0, the corresponding register will function as a t imer. tmod[1:0] m1:m0 selects the mode for timer/counter 0, as shown in table 20 . table 23 : the tcon register bit functions (sfr 0x88) bit symbol function tcon[7] tf1 the timer 1 overflow flag is set by hardware when timer 1 overflows. this flag can be cleared by software and is automatically cleared when an interrupt is processed. tcon[6] tr1 timer 1 run control bit. if cleared, timer 1 stops. tcon[5] tf0 timer 0 overflow flag set by hardware when timer 0 overflows. this flag can be cleared by software and is automatically cleared when an interrupt is processed. tcon[4] tr0 timer 0 run control bit. if cleared, timer 0 stops. tcon[3] ie1 interrupt 1 edge flag is set by hardware when the falling edge on external pin int1 is observed. cleared when an interrupt is processed. tcon[2] it1 interrupt 1 type control bit. selects either the falling edge or low l evel on input pin to cause an interrupt. tcon[1] ie0 interrupt 0 edge flag is set by hardware when the falling edge on external pin int0 is observed. cleared when an interrupt is processed. tcon[0] it0 interrupt 0 type control bit. selects either the falling edge or low l evel on input pin to cause interrupt. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 30 rev 2 1.4.8 wd timer (software watchdog timer) the re is no internal software watchdog timer. use the standard watchdog timer instead (see 1.5.16 hardware watchdog timer ). 1.4.9 interrupts the 80515 mpu provides 11 interrupt sources with four priority levels . each source has its own request flag(s) located in a special function register ( tcon , ircon and scon ) . each interrupt requested by the corresponding flag can be individually enabled or disabled by the enable bits in sf rs ien0 (sfr 0xa8), ien1 (sfr 0xb8) , and ien2 (sfr 0x9a ) . figure 8 shows the device interrupt structure. referring to figure 8 , interrupt sources can originate from within the 80515 mpu core (referred to as in ternal sources) or can originate from other parts of the 71m65 3 x soc (referred to as external sources). there are seven external interrupt sources, as seen in the leftmost part of figure 8 , and in table 24 and table 25 (i.e., ex0 - ex6 ). i nterrupt overview when an interrupt occurs, the mpu will vector to the predetermined address as shown in table 36 . once the interrupt service has begun, it can be interrupted only by a higher priority interrupt . the interrupt service is terminated by a return from instruction, reti . when an reti is performed, the processor will return to the instruction that would have been next when the interrupt occurred. when the interrupt condition occurs, the processor will also indicate thi s by setting a flag bit . this bit is set regardless of whether the interrupt is enabled or disabled . each interrupt flag is sampled once per machine cycle, after that, samples are polled by the hardware . if the sample indicates a pending interrupt when the interrupt is enabled, then the interrupt request flag is set . on the next instruction cycle, the interrupt will be acknowledged by hardware forcing an lcall to the appropriate vector add ress, if the following conditions are met: ? no interrupt of equal or higher priority is already in progress. ? an instruction is currently being executed and is not completed. ? the instruction in progress is not reti or any write access to the r egisters ien0 , ien1 , ien2 , ip0 or ip1 . special function registers for interrupts the following sfr registers control the interrupt functions: ? the interrupt enable registers: ien0 , ien1 and ien2 (see table 24 , table 25 and table 26 . ? the timer/counter control registers, tcon and t2con (see table 27 and table 28 ). ? the interrupt request r egister , ircon (see table 29 ). ? the interrupt priority registers: ip0 and ip1 (see table 34 ). table 24 : the ien0 bit functions (sfr 0xa8) bit symbol functio n ien0 [7] eal eal = 0 disable s all interrupts . ien0 [6] wdt not used for interrupt control . ien0 [5] C not used. ien0 [4] es0 es0 = 0 disable s serial channel 0 interrupt . ien0 [3] et1 et1 = 0 disable s timer 1 overflow interrupt . ien0 [2] ex1 ex1 = 0 disable s external interrupt 1 . ien0 [1] et0 et0 = 0 disable s timer 0 overflow interrupt . ien0 [0] ex0 e x0 = 0 disable s external interrupt 0 . downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 31 table 25 : the ien1 bit functions (sfr 0xb8) bit symbol function ien1[7] C not used. ien1[6] C not used. ien1 [5] ex6 ex6 = 0 disable s external interrupt 6 : xfer_busy, rtc_1sec, wd_nrovf ien1 [4] ex5 ex5 = 0 disable s external interrupt 5 : eeprom_busy ien1 [3] ex4 ex4 = 0 disable s external interrupt 4: pll_ok (rise), pll_ok (fall) ien1 [2] ex3 ex3 = 0 disable s external interrupt 3 : ce_busy ien1 [1] ex2 ex2 = 0 disable s external interrupt 2: fwcol0, fwcol1, spi ien1 [0] C not used. table 26 : the ien2 bit functions (sfr 0x9a) bit symbol function ien2[0] es1 es1 = 0 disable s the serial channel 1 interrupt . table 27 : tcon bit functions (sfr 0x88) bit symbol function tcon[7] tf1 timer 1 overflow flag . tcon [6] tr1 not used for interrupt control . t con[5] tf0 timer 0 overflow flag . tcon[4] tr0 not used for interrupt control . tcon[3] ie1 external interrupt 1 flag . tcon[2] it1 external interrupt 1 type control bit : 0 = interrupt on low level . 1 = interrupt on falling edge . tcon[1] ie0 external interrupt 0 flag tcon[0] it0 external interrupt 0 type control bit : 0 = interrupt on low level . 1 = interrupt on falling edge . table 28 : the t2con b it functions (sfr 0xc8) bit symbo l function t2con[7] C not used . t2con[6] i3fr polarity control for external interrupt 3: ce_busy 0 = falling edge . 1 = rising edge . t2con[5] i2fr polarity control for external interrupt 2: fwcol0, fwcol1 , spi 0 = falling edge. 1 = rising edge. t2con[4:0] C not used . table 29 : the ircon bit functions (sfr 0xc0) bit symbol function ircon[7] C not used ircon[6] C not used ircon[5] iex6 1 = external interrupt 6 occurred and has not been cleared. irco n[4] iex5 1 = external interrupt 5 occurred and has not been cleared. ircon[3] iex4 1 = external interrupt 4 occurred and has not been cleared. ircon[2] iex3 1 = external interrupt 3 occurred and has not been cleared. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 32 rev 2 ircon[1] iex2 1 = external interrupt 2 occurred and has not been cleared. ircon[0] C not used . tf0 and tf1 (timer 0 and timer 1 overflow flag s ) will be automatically cleared by hardware when the service routine is called (signals t0ack and t1ack C port isr C active high when the service routine is called). external mpu interrupts the seven external interrupts are the interrupts external to the 80515 core, i.e. signals that originate in other parts of the 71m6531 d/f or 71m6532d/f , for example the ce, dio, rtc or eeprom interface. the external interrupts are connected as described in table 30 . the po larity of interrupts 2 and 3 is pro grammable in the mpu via the i3fr and i2fr bits in t2con (sfr 0xc8) . interrupts 2 and 3 should be programmed for falling sensitivity ( i3fr = i2fr = 0). the generic 8051 mpu literature states that interrupts 4 through 6 are defined as rising - edge sensitive. thus, the hardware signals attached to interrupts 5 and 6 are inverted to achieve the edge polarity shown in table 30 . table 30 : external mpu interrupts external interrupt connection polarity flag reset 0 digital i/o high priority see section 1.5.7 automatic 1 digital i/o low priority see section 1.5.7 automatic 2 fwcol0, fwcol1 , spi falling automatic 3 ce_busy falling automatic 4 pll_ok (rising), pll_ok (falling) rising automatic 5 eeprom busy falling automatic 6 xfer_busy, rtc_1sec or wd_nr ovf falling manual external interrupt 0 and 1 can be mapped to pins on the device using dio reso urce maps. see section 1.5.7 digital i/o for more information. fwcolx interrupts occur when the ce collides with a flash write at tempt . see the f lash w rite description in the flash memory section for more detail. sfr enable bits must be set to permit any of these interrupts to occur . likewise, each interrupt has its own flag bit, which is set by the interrupt hardware, and reset by the mpu interrupt handler . xfer_busy, rtc_1sec, wd_nrovf, fwcol0, fwcol1, spi, pllrise and pllfall have their own enable and flag bits in addition to the interrupt 6, 4 and enable and flag bits (see table 31 ). ie0 through iex6 are cleared automatically when the hardware vectors to the int errupt handler . the other flags, ie_xfer through ie_pb, are cleared by writing a zero to them . since these bits are in an sfr bit addressable byte, common practice would be to clear them with a bit operation, but this must be avoided . the hardware implements bit operations as a byte - wide read - modify - write hardware macro . if an interrupt occurs after the read, but before the write, its flag will be cleared un intentionally . the proper way to clear the flag bits is to write a byte mask cons isting of all ones except for a zero in the locat ion of the bit to be cleared . the flag bits are configured in hardware to ignore ones written to them. table 31 : interrupt enable and flag bits interrupt enable interrupt flag interrupt description n ame location n ame location ex0 sfr a8[0] ie0 sfr 88[1] external interrupt 0 ex1 sfr a8[2] ie1 sfr 88[3] external interrupt 1 ex2 sfr b8[1] iex2 sfr c0[1] external interrupt 2 ex3 sfr b8[2] iex3 sfr c0[2] external interrupt 3 downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 33 interrupt enable interrupt flag interrupt description n ame location n ame location ex4 sfr b8[3] iex4 sfr c0[3] external interrupt 4 ex5 sfr b8[4] iex5 sfr c0[4] external interrupt 5 ex6 sfr b8[5] iex6 sfr c0[5] external interrupt 6 ex_xfer 2002[0] ie_xfer sfr e8[0] xfer_busy interrupt (int 6) ex_rtc 2002[1] ie_rtc sfr e8[1] rtc_1sec interrupt (int 6) ien_wd_nrovf 20b0[0] wd_nrovf_flag 20b1[0] wdt near overflow (int 6) ien_spi 20b0[4] spi_flag 20b1[4] spi interface (int2) ex_fwcol 2007[4] ie_fwcol0 sfr e8[3] fwcol0 interrupt (int 2) ie_fwcol1 sfr e8[2] fwcol1 interrupt (int 2) ex_pll 2007[5] ie_pllrise sfr e8[6] pll_ok rise interrupt (int 4) ie_pllfall sfr e8[7] pll_ok fall interrupt (int 4) ie_wake sfr e8[5] autowake flag ? ie_pb sfr e8[4] pb flag ? ? the autowake and pb flag bits are shown in table 31 because they behave similarly to interrupt flags, even though they are not actually related to an interrupt . these bits are set by hardware when the mpu wakes from a push button or wake time out . the bits are reset by writing a zero . note that the pb flag is set whenever the pb is pushed, even if the part is already awake. wd_nr ovf _flag is set approximately 1 ms before a wdt reset occurs. the flag can be cleared by wri t- ing a zero to it and is automatically cleared by the falling edge of wake. interrupt priority level structure all interrupt sources are combined in groups, as shown in table 32 : table 32 : interrupt priority level groups group group members 0 external interrupt 0, serial channel 1 interrupt 1 timer 0 interrupt, external interrupt 2 2 external interrupt 1, external interrupt 3 3 timer 1 interrupt, external interrupt 4 4 serial channel 0 interrupt, external interrupt 5 5 external interrupt 6 each group of interrupt sources can be programmed individually to one of four pri ority levels (as shown in table 33 ) by setting or clearing one bit in the sfr interrupt priority register ip0 and one in ip1 ( table 34 ). if requests of the same priority level are received simultaneously, an i nternal polling sequence as shown in table 35 determines which request is serviced first. changing interrupt priorities while interrupts are enabled can easily caus e software defects. it is best to set the interrupt priority registers only once during initialization before interrupts are enabled. table 33 : interrupt priority levels ip1 [x] ip0 [x] priority level 0 0 level 0 (lowest) 0 1 level 1 1 0 level 2 1 1 level 3 (highest) downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 34 rev 2 table 34 : interrupt priority registers ( ip0 and ip1 ) register address bit 7 (msb) bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 (lsb) ip0 sfr 0xa9 C C ip0[5] ip0[4] ip0[3] ip0[2] ip0[1] ip0[0] ip1 sfr 0xb9 C C ip1[5] ip1[4] ip1[3] ip1[2] ip1[1] ip1[0] table 35 : interrupt polling sequence external interrupt 0 polling sequence serial channel 1 interrupt timer 0 interrupt external interrupt 2 external interrupt 1 external interrupt 3 timer 1 interrupt external interrupt 4 serial channel 0 interrupt external interrupt 5 external interrupt 6 interrupt sources and vectors table 36 shows the interrupts with their associated flags and vector addresses. table 36 : interrupt vectors interrupt request flag description interrupt vector address ie0 external interrupt 0 0x0003 tf0 timer 0 interrupt 0x000b ie1 external interrupt 1 0x0013 tf1 timer 1 interrupt 0x001b ri0/ti0 serial channel 0 interrupt 0x0023 ri1/ti1 serial channel 1 interrupt 0x0083 iex2 external interrupt 2 0x004b iex3 external interrupt 3 0x0053 iex4 external interrupt 4 0x005b iex5 external interrupt 5 0x0063 iex6 external interrupt 6 0x006b downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 35 tcon . 1 ( ie 0 ) individual enable bits s 1 con . 0 ( ri 1 ) s 1 con . 1 ( ti 1 ) individual flags internal source > = 1 tcon . 5 ( tf 0 ) tcon . 3 ( ie 1 ) tcon . 7 ( tf 1 ) s 0 con . 0 ( ri 0 ) s 0 con . 0 ( ti 0 ) > = 1 ircon . 1 ( iex 2) i 2 fr ircon . 2 ( iex 3) i 3 fr ircon . 3 ( iex 4) ircon . 4 ( iex 5) ircon . 5 ( iex 6) ien 0 . 7 ( eal ) ip 1 . 0 / ip 0 . 0 ip 1 . 1 / ip 0 . 1 ip 1 . 2 / ip 0 . 2 ip 1 . 3 / ip 0 . 3 ip 1 . 4 / ip 0 . 4 ip 1 . 5 / ip 0 . 5 interrupt flags priority assignment interrupt vector polling sequence interrupt enable logic and polarity selection dio timer 0 timer 1 ce_busy uart 0 eeprom xfer _ busy rtc_1s ex_rtc pll ok external source dio _ rn dio _ rn i2c > = 1 flash write collision > = 1 ien 2 . 0 ( es 1 ) ien 0 . 1 ( et 0 ) ien 0 . 0 ( ex 0 ) ien 1 . 1 ( ex 2 ) ien 0 . 2 ( ex 1 ) ien 1 . 2 ( ex 3 ) ien 0 . 3 ( et 1 ) ien 1 . 3 ( ex 4 ) ien 0 . 4 ( es 0 ) ien 1 . 4 ( ex 5 ) ien 1 . 5 ( ex 6 ) ie_xfer ie_rtc ex_xfer > = 1 ex_eex ex_spi ie_eex ie_spi it 0 ie_fwcol1 spi_flag uart1 ( optical ) 0 2 1 3 4 5 6 no . flag = 1 means that an inter - rupt has oc - curred and has not been cleared ex0 C ex6 are cleared automatically when the hardware vectors to the interrupt handler byte received byte transmitted overflow occurred overflow occurred byte received byte transmitted accumulation cycle completed pll status changed ce completed code run and has new status information dio status changed dio status changed every second busy fell command received spi i / f write attempt , ce busy 2 / 2 / 2009 ie_fwcol0 dio nr_ovf ex_fwcol ex_pll ie_pllrise ie_pllfall ien_spi ien_nr_ wdovf wd_nrovf_flag ce code start , flash write busy wdt near overflow > = 1 mpu - external sources mpu - internal sources figure 8 : interrupt structure downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 36 rev 2 1.5 on - chip resources 1.5.1 oscillator the oscillator of the 71m6531 d/ f and 71m6532d/f drives a standard 32.768 khz watch crystal . these crystals are accurate and do not require a high - current oscillator circuit . the oscillator of the 71m6531d/f and 71m6532d/f has been designed specifically to handle these crystals and is compatible with their high impedance and limited power handling capability. oscillator calibration can improve the accuracy of both the rtc and metering. refer to section 1.5.3 r e- al - time clock (rtc) for more information. the oscillator is powered directly and only from vbat, which therefore must be connected to a dc vol tage source. the oscillator requires approximately 100 na, which is negl igible compared to the internal leakage of a battery . the oscillator may appear to work when vbat is not connected, b ut this mode of operation is not re commended. if vbat is connected to a drained battery or disconnected, a battery tes t that sets bme may drain vbats supply and cause the oscillator to stop. a stopped oscillator may force the device to reset. therefore, an unexpected reset during a battery test should be interpreted as a batt ery failure. 1.5.2 internal clocks timing for the device is derived from the 32.768 khz crystal oscillator output . on - chip timing functions include : ? t he mpu clock (ckmpu) ? t he emulator clock (2 x ckmpu) ? t he clock for the ce (ckce) ? t he clock driving the delta - sigma adc along with the fir (ckadc, ckfi r) ? a real time clock (rtc). the two general - purpose counter/timers contained in the mpu are controlled by ckmpu (see section 1.4.7 timers and counters ) . table 37 provides a summary of the available clock functions . table 37 : clock system summary clock derived from mck divider / [ m40mhz, m26mhz ] brownout mode 2 / [1,0] 3 / [0,1] 4 ** / [0,0] ckpll crystal 78.6432 mhz 78.6432 mhz 78.6432 mhz off mck ckpll 39.3216 mhz 26.2144 mhz 19.6608 mhz 112 khz ckce mck 4.9152 mhz ? 9.8304 mhz ? 6.5536 mhz 4.9152 mhz off ckadc / ckfir mck 4.9152 mhz 6.5536 mhz 4.9152 mhz 28 khz ckmpu maximum mck 9.8304 mhz *** 6.5536 mhz *** 4.9152 mhz *** 28 khz ck32 mck 32.768 khz 32.768 khz 32.768 khz ** default state at power - up *** the maximum ckmpu frequency . ckmpu can be reduced from this rate using mpu_div[2:0] . ? ckce = 9.8304 mhz when ce1 0mhz is set, 4.9152 mhz otherwise. the master clock, mck, is generated by an on - chip pll that multiplies the oscillator output frequency (ck32) by 2400 to provide approximately 80 mhz ( 78. 6432 mhz). a divider controlled by the i/o ram bits m40mhz and m26mhz permits scaling of mck by ?, ? and ?. all other clocks are derived from this scaled mck output (making them multiples of 32768 hz), and the clock skew is matched so that the rising edges of ckadc, ckce, ck32 and ckmpu are aligned. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 37 the pll generate s a 2 x emulator clock which is controlled by the eck_dis bit . since clock noise from this feature may disturb the adc, it is recommended that this option be avoided when possible. the mpu clock frequency ckmpu is determined by another divider controlled b y the i/o ram field mpu_div[2:0] and can be set to mck/2 ( mpu_div +2) hz where mpu_div[2:0] varies from 0 to 6. the circuit also generates the 2 x ckmpu clock for use by the emulator. the emulator cl ock is not generated when eck_dis is asserted. during a power - on reset, [ m40mhz, m26mhz ] defaults to [0, 0] and the mck divider is set to divide by 4. when [ m40mhz , m26mhz ] = [1,0], the ce clock frequency may be set to ~ 5 mhz ( 4.9152 mhz) or ~ 10 mhz ( 9.8304 mhz) , using the i/o ram register ce10mhz . in this mode, the adc and fir clock freque n- cies remain at ~ 5 mhz. when [ m40mhz , m26mhz ] = [ 0,1 ] , the ce, adc, fir and mpu clock freque n- cies are shifted to ~ 6.6 mhz ( 6.5536 mhz ) . this increases the adc sample rate by 33%. ce codes are tailored to particular ce clock frequencies. changing the clock frequency for a par ticular ce code may render it unusable. in sleep mode, the m40mhz and m26mhz inputs to the clock generator are forced low. in brownout mode, the clocks are derived from the crystal oscillator a nd the clock frequencies are scaled by 7/8. 1.5.3 real - time clock (rtc) the rtc is driven directly by the crystal oscillator . it is powered by the net rtc_nv (battery - backed up supply) . the rtc consists of a counter chain and output registers . the counter chain consists of registers for seconds, minutes, hours, day of week, day of month, month and year . the rtc is capable of pr o- cessing leap years . each counter has its own output register . whenever the mpu reads the seconds register, all other output registers are automatically updated . since the rtc clock (rtclk) is not coherent to the mpu clock, the mpu must read the seconds register until two consec utive reads are the same (this requires either 2 or 3 reads) . at this point, all rtc output registers will have the correct time . regardless of the mpu clock speed, rtc reads require one wait state. rtc time is set by writing to the registers rtc_sec [5:0] through rtc_yr . each write operation must be preceded by a write operation to the we register in i /o ram. the value written to the we register is un im portant. time adjustments are written to the rtca_adj [6:0] , pre g [16:0] and qreg[1:0] registers . updates to preg[16:0] and qreg[1:0] must occur after the one second interrupt and must be finished before reaching the next one second boundary . the new values are loaded into the counters at the next one second boundary. preg[16:0] and qreg[1:0] are separate registers in the device hardware, but the bits are 16 - bit contiguous so the mpu firmware can treat them as a single register. a single binary number can be calculated and then loaded into them at the same time. the 71m6531 d/ f and 71m6532d/f ha ve two rate adjustment mechanisms . the first is an analog rate adjustment, using r tca_adj[6:0], which trims the crystal load capacitance . setting rtca_adj[6:0] to 00 minimizes the load capacitance, maximizing the oscillator frequency . setting rtca_adj[6:0] to 0x 3 f maximizes the load capacitance, minimizing the oscillator frequency . t he adjustable capacitance is ap proximately: pf adj rtca c adj 5.16 128 _ ? = the maximum adjustment range is approximately - 12 ppm to +22ppm . the precise amount of adjustment will depend on the crystal properties . the adjustment may occur at any time and the resulting clock fre quency can be measured over a one - second interval . the second rate adjustment is a digital rate adjust using preg[16:0] and qreg[1:0] , which can be used to adjust the clock rate up to 988 ppm, with a resolution of 3.8 ppm . update s must occur after a one second interrupt and must finish before the next one second boundary . the rate adjustment will be im plemented starting at the next one second boundary . since the lsb results in an adjustment every four seconds, the frequency should be measured over an interval that is a multipl e of four seconds . downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 38 rev 2 to adjust the clock rate using the digital rate adjust, the appropriate val ues must be written to preg[16:0] and qreg[1:0] . the default frequency is 32,768 rtclk cycles per second . t o shift the clock frequency by ? ppm, calculate preg[16:0] and qreg[1:0] using the following equation: ?? ? ?? ? + ??+ ? = + ? ? 5.0 10 1 8 32768 4 6 floor qreg preg for example, for a shift of - 988 ppm, 4 ? preg + qreg = 262403 = 0x40103 . preg[16:0] = 0x10040 and qreg[1:0] = 0x03 . the default values of preg[16:0] and qreg[1:0] , corresponding to zero adjustment, are 0x10000 and 0x0, respectively . the rtc timing may be observed on the tmuxout pin by setting tmux[4:0] to 0x10 or 0x11. default values for rtc a _adj , preg[16:0] and qreg[1 :0] should be nominal values, at the center of the ad justment range. extreme values (zero for example) can cause incorrect operation. if the crystal temperature coefficient is known, the mpu can integrate temperat ure and correct the rtc time as necessary. both rtca_adj[6:0] and preg[16:0] / qreg[1:0 ] are non - volatile registers, i.e. their values will be pr e- served in brownout, sleep and lcd modes. however, the digital correcti on controlled by the preg [16:0] / qreg [1:0] registers is not operational in sleep mode . the digital adjustment using preg [16:0] and qreg [1:0] is preferred over the analog adjustment using rtca_adj: th e digital adjustment is more repeatable and has a wider range. the sub - second register of the rtc, subsec , can be read by the mpu after the o ne second interrupt and before reaching the next one second boundary . subsec contains the count remaining, in 1/256 second nominal clock periods, until the next one second boundary . when the rst_subsec bit is written, the subsec counter is restarted . reading and resetting the sub - second counter can be used as part of an algorithm to accurately set the rtc. when se tting the rtc_sec register , it is important to take into account that the associated write operation w ill be performed only in the next second bo u ndary. see application note an4947 for details on rtc. 1.5.4 temperature sensor the device includes an on - chip temperature sensor for determining the temperature of the bandgap re ference . if automatic temperature measurement is not performed by selecting chop_e[1:0] = 00, t he mpu may request an alternate multiplexer frame containing the temperature sensor output by asserting mux_alt . the primary use of the temperature data is to determine the magnitude of compensation re quired to offset the thermal drift in the system (see section 3.4 temperature compensation ). 1.5.5 physical memory flash memory the 71m6531d and 71m6532d include 128 kb of on - chip flash memory . the 71m6531f and 71m6532 f offer 256 kb of flash memory . the flash memory primarily contains mpu and ce program code . it also con tains images of the ce and mpu data in ram, as well as of i/o ram . on power - up, before enabling the ce, the mpu copies these images to their respective locations. the flash memory is segmented into individually erasable pages that contain 1 024 bytes. f lash space allocated for the ce program is limited to 4096 16 - bit words (8 kb) . the ce program must begin on a 1 - kb boundary of the flash address space . the ce_lctn[ 7 :0] word defines which 1 - kb boundary contains the ce code . thus, the first ce instruction is located at 1024* ce_lctn[7 :0] . flash write procedures the mpu may write to the flash memory. this is one of the non - volatile storage options available to the user in addition to external eeprom. flsh_pwe (flash program write enable) differentiates 80515 data store instructions (movx @dptr,a) between flash and xram write operations . this bit must be cleared by the mpu after each byte write operation. write operations to this bit are inhibited when interrupts are enabled. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 39 the mpu cannot write to flash while the ce is executing its code from flas h. two interrupts warn of collisions between the mpu firmware and the ce timing. if a flash write operation i s attempted while the ce is busy, the flash write will not execute and the fwcol0 interrupt will be is sued. if a flash write is still in progress when the ce would otherwise begin a code pass, the code pass is skipped, the write operation is completed, and the fwcol1 interrupt is issued. the simplest flash write procedure disables the ce during the write operati on and interpolates the metering measurements. however, this results in the loss of at least one second of dat a, because the ce has to resynchronize with the mains voltage. there is a brief guaranteed interval (typically 1/32768 s) between ce execut ions which occurs 2520 times per second. the start of the interval can be detected with the ce_busy interrupt which occurs on the falling edge of ce_busy (an internal signal measurable from tmuxout). h owever, this guaranteed idle time (30.5 s) is too short to write a byte which takes 42 s or to erase a page of flash memory which takes at least 20 ms. some ce code has substantially longer idle times, but in those cases, firmware in terrupt latencies can easily consume the available write time. if a flash write fails in this scheme, the failure can be detected with the fwcol0 or fwcol1 interrupt and the write can be retried. it is practical to pre - erase pages, disable interrupts and poll the ce_busy interrupt flag, ircon[2] . this method avoids problems with interrupt latency, but can still result in a write failure if the ce code takes to much time. as mentioned above, polling fwcol0 and fwcol1 can detect write f ailures. however, the speed in a polling write is only 2520 bytes per second and the firmware cannot r espond to interrupts. as an alternative to using flash, a small eeprom can store data without compro mises. eeprom interfaces are included in the device. updating i ndividual b ytes in f lash m emory the original state of a flash byte is 0xff (all ones). once a value other than 0xff is written to a flash memory cell, over writ ing with a different value usually requires that the cell be erased fir st. since cells cannot be erased individually, the page has to be copied to ram, followed by a page erase. after this, the page can be updated in ram and then written back to the flash memory. flash erase procedures flash erasure is initiated by writing a specific data pattern t o specific sfr registers in the proper sequence. these special pattern/sequence requirements prevent inadvertent erasure of the flash memory. the mass erase se quence is: 1. write 1 to the flsh_meen bit ( sfr 0xb2[1] ). 2. write pattern 0xaa to flsh_erase ( sfr 0x94 ). the mass erase cycle can only be initiated when the ice port is enabled. the page erase sequence is: 1. write the page address to flsh_pgadr [5:0] ( sfr 0xb7[7:1] ) . 2. write pattern 0x55 to flsh_erase ( sfr 0x94 ). note: transitions to brownout mode must be avoided during page erase operations . bank - switching: the program memory of the 71m6531 consists of a fixed lower bank of 32 kb addressable at 0x0000 to 0x7fff plus an upper bank area of 32 kb, addressable at 0x8000 to 0xffff . the upper 32 kb space is banked using the i/o ram fl_bank register as follows: ? the 71m6531d provide s 4 banks of 32 kb each selected by fl_bank[1:0] . note that when fl_bank[1:0] = 00, the upper bank is the same as the lower bank. ? the 71m6531f and 71m6532d/f provide 8 banks of 32 kb each selected by fl_bank[2:0] . table 38 illus trates the bank switching mechanism . downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 40 rev 2 table 38 : bank switching with fl_bank[2:0] 7 1m6531 d fl_bank [1:0] 71m653x f fl_bank [2:0] address range for lower bank (0x000 - 0x7fff) address range for upper bank (0x8000 - 0xffff) 000 000 0x0000 - 0x7fff 0x0000 - 0x7fff 001 001 0x8000 - 0xffff 010 010 0x10000 - 0x17fff 011 011 0x18000 - 0x1ffff 100 0x20000 - 0x217ff 101 0x28000 - 0x2ffff 110 0x30000 - 0x37fff 111 0x38000 - 0x3ffff program security when enabled, the security feature limits the ice to global flash erase operations onl y. all other ice op erations are blocked. this guarantees the security of the users mpu and c e program code. security should be enabled by mpu code that is executed dur in g the pre - boot interval (60 ckmpu cycle s before the primary boot sequence begins ) . once security is enabled, the only way to disable it is to perf orm a global erase of the flash, followed by a chip reset. the first 60 cycles of the mpu boot code are called the pre - boot phase because during this phase the ice is inhibited. a read - only status bit, preboot , identifies these cycles to the mpu. upon completion of pre - boot, the ice can be enabled and is permitted to take control of the mpu. t he security enable bit, secure , is reset whenever the chip is reset. hardware associated with the bit per mits only ones to be written to it. thus, pre - boot code may set secure to enable the security feature but may not reset it. once secure is set, the pre - boot code is protected and no external read of program code is possible specifically, when secure is set , the following applies : ? the ice is limited to bulk flash erase only. ? page zero of flash memory, the preferred location for the users pre - boot code, may not be page - erased by either mpu or ice. page zero may only be erased with global fl ash erase. ? write operations to page zero, whether by mpu or ice are inhibited. mpu/ce ram: the 71m6531 d/ f and 71m6532d/f include 4 kb of static ram memory on - chip (xram) plus 256 - bytes of internal ram in the mpu core . the 4 kb of static ram are used for data storage for mpu and ce op erations . 1.5.6 optical interface the device includes an interface to implement an ir/optical port. the pin o pt_tx is designed to directly drive an external led for transmitting data on an optical link. the pin opt _rx has the same threshold as the rx pin, but can also be used to sense the input from an external pho to detector used as the re ceiver for the optical link. opt_tx and opt_rx are connected to a dedicated uart port (uart1). the opt_tx and opt_rx pins can be inverted with configuration bits opt_txinv and opt_rxinv , re spectively . additionally, the opt_tx output may be modulated at 38 khz . modulation is available when system po wer is present (i.e. not in brownout mode) . the opt_txmod bit enables modulation . duty cycle is controlled by opt_fdc[1:0] , which can select 50%, 25%, 12.5% and 6.25% duty cycle . 6.25% duty cycle means opt_tx is low for 6.25% of the period . figure 9 illustrates the opt_tx generator. when not needed for the optical uart, the opt_tx pin can alternatively be configured as dio2, wpulse, or varpulse . the configuration bits are opt_txe[1:0] . likewise, opt_rx can a lternately be configured as dio 1 . its control is opt_rxdis . downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 41 b a opt_txmod = 0 opt_txmod = 1, opt_fdc = 2 (25%) b a 1/ 38 khz opt_txinv from opt_tx uart mod en duty opt_tx opt_txmod opt_fdc opt_txe[1:0] 1 2 v3p3 internal a b 0 2 3 dio2 wpulse varpulse figure 9 : optical interface 1.5.7 digital i/o C 71m6531d/f the 71m6531 d/f in cludes up to 22 pins of general - purpose digital i/o . these pins are compatible with 5 v inputs (no current limiting resistors are needed). the digital i/o p ins can be categorized as follows: ? dedicated dio pins (1 pin ): pb ? dio/lcd segment pins (a total of 19 pins) : o dio4/se g24 - dio15/seg35 (12 pins) o dio17/seg37 (1 pin ) o dio28/seg48 C dio29/seg49 (2 pins) o dio43/seg63 - dio46/seg66 (4 pins ) ? dio pins combined with other functions (2 pins): dio2/opt_tx, dio1/opt_r x the pins dio4/seg24 through d io46 /seg 66 are configured by the lcd_ bit map r egisters to be dio or segment pins . a one in lcd_ bitmap defines the pin as a lcd segment output, a zero makes the pin a dio pin . pins configured as lcd pins are controlled with the lcd_segnn registers . pins configured as dio can be defined independently as an input or output with the dio_dir bits (see table 45 ). write operation s to a disabled dio are not ignored. write operation s are registered, but do not affect the pin, or the result of a read operation on the pin, until it becomes a dio output. dio2/opt_tx will be an active tx output pin at power up ( opt_tx e[1:0] = 00). a 3 - bit configuration w ord, i/o ram field dio_rx [2:0] (0x2009[2:0] through 0x200e[6:4 ]) , can be used for certain pins (when configured as dio) to individually assign an internal resource such as an interrupt or a timer control (see table 46 for dio pins available for this option). this way, dio pins can be tracked even if they are configured as outputs. table 39 to table 41 lists the direction registers and configurability associated with each group of dio pins. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 42 rev 2 table 39 : data/direction registers and internal resources for dio 1- 15 (71m6531 d/f ) dio pb 1 2 C 4 5 6 7 8 9 10 11 12 13 14 15 lcd segment C C C C 24 25 26 27 28 29 30 31 32 33 34 35 pin n umber 65 60 3 C 39 40 41 42 43 44 45 46 68 30 21 22 configuration (dio or lcd segment) C C C C 0 1 2 3 4 5 6 7 0 1 2 3 l cd_ bitmap[31:24] lcd_bitmap[39:32] data register 0 1 2 C 4 5 6 7 0 1 2 3 4 5 6 7 dio0 = p0 (sfr 0x80) dio1 = p1 (sfr 0x90) direction re gister C 1 2 C 4 5 6 7 0 1 2 3 4 5 6 7 dio_dir0 (sfr 0xa2) dio_dir1 (sfr 0x91) internal re sources configurable C C C C y y y y y y y y C C C C table 40 : data/direction registers and internal resources for dio 17 - 29 (71m6531d/f) dio C 17 C C C C C C C C C C 28 29 C C lcd segment C 37 C C C C C C C C C C 48 49 C C p in number C 13 C C C C C C C C C C 47 24 C C configur ation (dio or lcd segment) C 5 C C C C C C C C C C 0 1 C C lcd_ bitmap[39:32] lcd_ bitmap[55:48] data register C 1 C C C C C C C C C C 4 5 C C dio2 = p2 (sfr 0xa0) dio3 = p3 (sfr 0xb0) direction re gister 0 = input, 1 = output C 1 C C C C C C lcd_seg48[3] lcd_seg49[3] dio_dir2 (sfr 0xa1) table 41 : data/direction registers and internal resources for dio 43 - 46 (71m6531d/f) dio C C C 43 44 45 46 C lcd segment C C C 63 64 65 66 C pin number C C C 29 23 28 5 C configuration (dio or lcd segment) C C C 7 0 1 2 C lcd_bitmap[63:56] lcd_bitmap[64:71] data register C C C lcd_seg63 [0] lcd_seg64[0] lcd_seg65[0] lcd_seg66[0] C direction register 0 = input, 1 = output C C C lcd_seg63 [3] lcd_seg64[3] lcd_seg65[3] lcd_seg66[3] C downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 43 1.5.8 digital i/o C 71m6532d/f the 71m6532d/f includes up to 43 pins of general - purpose digital i/o. t hese pins are compatible with 5 v inputs (no current limiting resistors are needed). the digital i/o p ins can be categorized as follows: ? dedicated dio pins (4 pin s ): o dio3 o dio56 C dio58 (3 pins) ? dio/lcd segment pins (a total of 37 pins) : o dio4/seg24 C dio27/seg47 (24 pins) o dio29/seg49, dio30/seg 5 0 (2 pins) o dio40/seg60 C dio45/seg65 (6 pins) o dio47/seg67 C dio51/seg71 (5 pins ) ? dio pins combined with other functions (2 pins): dio2/opt_tx, dio1/opt_ rx on reset or power - up, all dio pins are inputs until they are configured for the desired directi on under mpu control. the pin function can be configured by the i/o ram bits lcd_bitmapn . setting lcd_bitmapn = 1 configures the pin for lcd, setting lcd_ bitmapn = 0 configures it for dio. once a pin is configured as dio, it can be configured independently as an input or output with the dio_dir bits or the lcd_segn registers. input and output data are written to or read from the pins using s fr registers p 0, p1 , and p2 . table 42 to table 44 shows the dio pins with their configuration, direction control and data r egisters. table 42 : data/direction registers and internal resources for dio 1- 15 ( 71m6532d/f ) dio pb 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 lcd segment C C C C 24 25 26 27 28 29 30 31 32 33 34 35 pin nu mber 92 87 3 17 60 61 62 63 67 68 69 70 100 44 29 30 configura tion (dio or lcd segment) always dio 0 1 2 3 4 5 6 7 0 1 2 3 lcd_bitmap[31:24] lcd_bitmap[39:32] data register 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 dio0 = p0 (sfr 0x80) dio1 = p1 (sfr 0x90) direction re gister 0 = input, 1 = output C 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 dio_dir0 (sfr 0xa2) dio_dir1 (sfr 0x91) internal re sources configurable y y y y y y y y y y y y C C C C table 43 : data/direction registers and internal resources for dio 16 - 30 (71m6532d/f) dio 16 17 18 19 20 21 22 23 24 25 26 27 C 29 30 C lcd segment 36 37 18 39 40 41 42 43 44 45 46 47 C 49 50 C pin number 33 12 13 64 65 66 93 54 46 43 42 41 C 32 35 configuration (dio or lcd segment) 4 5 6 7 0 1 2 3 C C C C C 1 2 C lcd_bitmap[39:32] lcd_bitmap[47:40] lcd_bitmap[55:48 ] data register 0 1 2 3 4 5 6 7 0 1 2 3 C 5 6 C dio2 = p2 (sfr 0xa0) dio3 = p3 (sfr 0xb0) direction re gister 0 = input, 1 = output C 1 C 3 4 5 C C C C C C C lcd_seg49[3] lcd_seg50[3] C dio_dir2 (sfr 0xa1) downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 44 rev 2 table 44 : data/direction registers and internal resources for dio 40 - 51 (71m6532d/f) dio 40 41 42 43 44 45 C 47 48 49 50 51 lcd segment 60 61 62 63 64 65 C 67 68 69 70 71 pin number 95 97 98 40 31 38 C 22 23 24 25 50 configuration (dio or lcd segment) 4 5 6 7 0 1 C 3 4 5 6 7 lcd_bitmap[63:56 ] lcd_bitmap[71:64] data register lcd_seg60[0] lcd_seg61[0] lcd_seg62[0] lcd_seg63[0] lcd_seg64[0] lcd_seg65[0] C lcd_seg67[0] lcd_seg68[0] lcd_seg69[0] lcd_seg70[0] lcd_seg71[0] direction register 0 = input, 1 = output lcd_seg60[0] lcd_seg61[0] lcd_seg62[0] lcd_seg63[0] lcd_seg64[3] lcd_seg65[3] C lcd_seg67[3] lcd_seg68[3] lcd_seg69[3] lcd_seg70[3] lcd_seg71[3] dio24 and higher do not have sfr registers for direction control. dio40 and higher do not have sfr re gisters for data access. the direction control of these pins is achieved with the lcd_segn[3] bits and data access is controlled with the lcd_segn[0] bits in i/o ram. dio56 through dio58 are dedicated dio pins. they are controlled with dio_dir56[7] through dio_dir58[7] and with dio_56[4] through dio_58[4] in i/o ram. 1.5.9 d igital io C common characteristics for 71m6531d/f and 71m6532d/f on reset or power - up, all dio pins a re inputs until they are configured for the desired direction under mpu control. the pin function can be configured by the i/o ram bits lcd_bitmapn . setting lcd_bitmapn = 1 configures the pin for lcd, setting lcd_bitmapn = 0 configures it for dio. once a pin is configured as dio, it can be configured independently as an input or output with the dio_dir bits or the lcd_segn registers. input and output data are written to or read from the pins using s fr registers p0, p1 , and p2 . dio24 and higher do not have sfr registers for direction control. dio 40 and higher do not have sfr registers for data access. the direction control of these pins is achieved with the lcd_segn[3] registers and data access is controlled with the lcd_segn[0 ] registers in i/o ram. since the control for dio 24 through dio51 is shared with the control for lcd segments, the firmware must take care not to disturb the dio pins when accessing the lcd segments and vice versa. usuall y, this requires reading the i/o ram register, applying a mask and writing back the modified byte. table 45 : dio_dir control bit dio_dir [n] 0 1 dio pin n function input output table 46 : selectable control using dio_dir bits dio_r value resource selected for dio pin 0 none 1 reserved 2 t0 (counter 0 clock) 3 t1 (counter 1 clock) 4 high priority i/o interrupt (int0 rising) 5 low priority i/o interrupt (int1 rising) 6 high priority i/o interrupt (int0 falling) 7 low priority i/o interrupt (int1 falling) downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 45 additionally, if dio6 and dio7 are configured as dio and defined as outputs, they can be used as dedi cated pulse outputs (wpulse = dio6, varpulse = dio7) u sing the dio_pw and dio_pv bits . in this case, dio6 and dio7 are under ce control. dio4 and dio5 can be confi gured to implement the eeprom interface. the pb pin is a dedicated digi tal input. in addition, if the optical uart is not used, op t_tx and o pt_rx can be configured as dedicated dio pins, dio1 and dio2, respectively (see section 1.5.6 optical interface ). the internal control resources selectable for the dio pins are listed in table 46 . if more than one input is connected to the same resource, the resources are combined using a logical or. tracking dio pins configured as outputs is useful for pulse counting without external hardware. either the interrupts or the counter/timer clocks can be used to count pulses on the pulse outputs or interrupts on the ces power failure output. when driving leds, relay coils etc., the dio pins should sink the current into gndd (as shown in figure 10 , right), not source it from v3p3d (as shown in figure 10 , left). this is due to the re sis - tance of the i n ternal switch that connects v3p3d to either v3p3sys or vbat. sourcing current in to or out of dio pins other than the pb pin, for ex ample with pull - up or pull - down resistors, should be avoided. violating this rule will lead t o increased quiescent current in sleep and lcd modes. f igure 10 : connecting an external load to dio pins 1.5.10 lcd drivers C 71m6531d/f the 71m6531 contains a total of 39 dedicated and multiplexed lcd drivers which are grouped as follows: ? 11 dedicated lcd segment drivers C always available ? 3 drivers multiplexed with the ice interface (e_tclk, e_ rst, e_rxtx) C available in normal operation mode (when not emulating) ? 2 driver multiplexed with auxiliary signal s mux_sync and cktest (seg7, seg19) C available when not used for test ? 4 drivers multiplexed with the spi port (pclk, psdo, pcsz, psdi ) ? 19 mult i- use pins described in section 1.5.7 digital i/o C 71m6531d/f . ? 4 common drivers for multiplexing (25%, 33%, 50%, or 100% duty cycle) C always available with a minimum of 16 driver pins always available and a total of 39 driver pins in the maximum con figuration, the device is capable of driving between 64 to 156 pixels of lcd display with 25% du ty cycle . at eight pixels pe r digit, this corresponds to 8 to 19 digits . at 33% duty cycle, 48 to 117 pixels can be driven . for each multi - use pin, the corresponding lcd_bitma p [] bit ( see section 1.5.7 digital i/o C 71m6531d/f ), is used to select the pin for dio or lcd operation . the mapping of the lcd_bitmap[] bits is specified in v3p3sys vbat v3p3d dio gndd mission brownout lcd/sleep low high high-z v3p3sys vbat v3p3d dio gndd mission brownout lcd/sleep low high high-z downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 46 rev 2 section 4.1 i/o ram and sfr map C functional order . the lcd drivers are supported by the four com mon pins (com0 C com3). 1.5.11 lcd drivers C 71m6532d/f th e 71m6532d/f contains a total of 67 dedicated and multiplexed lcd drivers, which are grouped as follows: ? 15 dedicated lcd segment drivers (seg0 to seg2, seg8, seg12 - seg18 , seg20 C seg23 ) ? 4 drivers multiplexed with the spi port (seg3 to seg6) ? 2 driver s multiplexed with mux_sync (seg7) or cktest (seg19) ? 3 drivers multiplexed with the ice interface (seg9 to seg11) ? 43 multi - use lcd/dio pins described in section 1 .5.8 digital i/o C 71m6532d/f . with a minimum of 15 driver pins always available and a total of 6 7 driver pins in the maximum con figuration, the device is capable of driving between 60 to 26 8 pixels of an lcd display with 25% duty cycle. at eight pixels per digit , this corresponds to 7.5 to 3 3.5 digits. for each multi - use pin, the corresponding lcd_bitmap[ ] bit ( see section 1.5.8 digital i/o C 71m6532d/f ), i s used to select the pin for dio or lcd operation. the mapping of the lcd_bitmap[ ] bits is specified in section 4.1 i/o ram and sfr map C functional order . the lcd drivers are supported by the four co m mon pin s (com0 C com3) . 1.5.12 lcd drivers C common characteristics for 71m6531d/f and 71m6532d/f the lcd interface is flexible and can drive 7 - segment digits, 14 - segment digits or enunciator symbols. the lcd bias may be compensated for temperature using the lcd_ dac[2:0] bits in i/o ram. the bias may be adjusted from 1.4 v below the 3.3 v supply (v3p3sys in mission mode and brownout modes, vbat in lcd mode). when the lcd_dac[2:0] bits are set to 000, the dac is bypassed and powered down. this can be used to reduce current in lcd mode. segment driver s seg18 and seg19 can be configured to blink at either 0.5 hz or 1 hz. the blink r ate is controlled by lcd_y . there can be up to four pixels/segments connected to each of these drivers. lcd_blkmap18[3:0] and lcd_bl kmap19[3:0] identify which pixels, if any, are to blink. the most sig nificant bit corresponds to com3, the least significant to com0. 1.5.13 battery monitor the battery voltage is measured by the adc during alternative mux frames i f the bme (battery measure enable) bit is set . while bme is set, an on - chip 45 k ? load resistor is applied to the battery and a scaled fraction of the battery voltage is applied to the adc input . after each alternative mux frame, the result of the adc conversion is available at ram address 0x0b . bme is ignored and assumed zero when system power is not available . if vbat is connected to a drained battery or disconnected, a battery test t hat set s bme may drain vbats supply and cause the oscillator to stop. a stopped oscillator may force the device to reset. therefore, an unexpected reset during a battery test should be interpreted as a batt ery failure. battery measurement is not very linear but is very reproducible if properly calibrated . the best way to perform the calibration is to set the battery input to the desired failure v oltage and then have the mpu firmware record that measurement. after this, the battery measurement logic may use the recorded value as the battery failure limit. the same value can also be a calibration offs et for any battery voltage display. see section 5.4.4 battery monitor for details regarding the adc lsb size and the conversion accuracy. 1.5.14 eeprom interface the 71m6531 d/ f and 71m6532d/f provide hardware support for either a two - pin or a three - wire ( - wire) type of eeprom interface. the interfaces use the eectrl and eedata registers for communication . downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 47 two - pin eeprom interface the dedicated 2 - pin serial interface communicates with external eeprom devices . the interface is mul tiplexed onto the dio4 (sck) and dio5 (sda) pins and is selected by setting dio_eex[1:0] = 01. the mpu communicates with the interface through the sfr registers eedata and eectrl . if the mpu wishes to write a byte of data to the ee prom, it places the data in eedata and then writes the transmit code to eectrl . this initiates the transmit operation which is finished when the busy bit falls . int5 is also asserted when busy falls . the mpu can then check the rx_ack bit to see if the eeprom acknowledged the trans mission. a byte is read by writing the receive command to eectrl and waiting for the busy bit to fall . upon completion, the received data is in eedata . the serial transmit and receive clock is 78 khz during each transmission and then holds in a high state until the next transmission . the eectrl bits when the two - pin interface is selected are shown in table 47 . table 47 : eectrl bits for 2 - pin interface status bit name read/ write reset state polarity description 7 error r 0 positive 1 when an illegal command is received. 6 busy r 0 positive 1 when serial data bus is busy. 5 rx_ack r 1 negative 0 indicates that the eeprom sent an ack bit. 4 tx_ack r 1 negative 0 indicates when an ack bit has been sent to the eeprom . 3:0 cmd[3:0] w 0000 positive cmd[3:0] operation 0000 no - op command. stops the i 2 c clock (sck, dio4). if not issued, sck keeps toggling. 0010 receive a byte from the eeprom and send ack. 0011 transmit a byte to the eeprom. 0101 issue a stop sequence. 0110 receive the last byte from the eeprom and do not send ack. 1001 issue a start sequence. others no operation, set the error bit. the eeprom interface can also be operated by controlling the dio4 and dio5 pi ns directly. in this case, a resistor has to be used in series with sda to avoid data collisions due to limits in the speed at which the sda pin can be switched from output to input. c ontrolling dio4 and dio5 di rect ly is discouraged, because it may tie up the mpu to the point where it m ay become too busy to process interrupts . three - wire ( - wire) eeprom interface a 500 khz three - wire interface, using sdata, sck and a dio pin for cs is available . the interface is selected by setting dio_eex[1:0] = 2 (b 10 ) . the eectrl bits when the three - wire interface is selected are shown in table 48 . when eectrl is written, up to 8 bits from eedata are either written to the eeprom or read from the eeprom, depending on the values of the eectrl bits. the - wire eeprom interface is only functional when mpu_div[2:0] = 000. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 48 rev 2 table 48 : eectrl bits for the 3 - wire interface control bit name read/ write description 7 wfr w wait for ready . if this bit is set, the trailing edge of busy will be de layed until a rising edge is seen on the data line . this bit can be used during the last byte of a write command to cause the int5 interrupt to occur when the eeprom has finished its internal write sequence . this bit is ignored if hiz = 0. 6 busy r asserted w hile the serial data bus is busy . when the busy bit falls, an int5 interrupt occurs. 5 hiz w indicates that the sd signal is to be floated to high impedance immedi ately after the last sck rising edge. 4 rd w indicates that eedata is to be filled with data from eeprom. 3 :0 cnt[3:0] w specifies the number of clocks to be issued . allowed values are 0 through 8 . if rd=1, cnt bits of data will be read msb first and right justified into the low order bits of eedata . if rd=0, cnt bits will be sent msb first to the eeprom, shifted out of the msb of eedata . if cnt[3:0] is zero, sdata will simply obey the hiz bit. the timing diagrams in figure 11 through figure 15 describe the 3 - wire eeprom interface behavior . all commands begin when the eectrl register is written . transactions start by first raising the dio pin that is connected to cs . multiple 8 - bit or less commands such as those shown in figure 11 through figure 15 are then sent via eectrl and eedata . when the transaction is finished, cs must be lowered . at the end of a read transaction, the eeprom will be driving sdata, but will transition to hiz (high impedance) when cs falls . the firmware should then immediately issue a write command with cnt=0 and hiz=0 to take control o f sdata and force it to a low - z state. figure 11 : 3 - wire interface . write command, hiz=0 figure 12 : 3 - wire interface . write command, hiz=1 sclk (output) busy (bit) cnt cycles (6 shown) sdata (output) write -- no hiz d2 d3 d4 d5 d6 d7 eectrl byte written int5 sdata output z (loz) cnt cycles (6 shown) write -- with hiz int5 eectrl byte written sclk (output) busy (bit) sdata (output) d2 d3 d4 d5 d6 d7 (hiz) (loz) sdata output z downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 49 figure 13 : 3 - wire interface . read command. figure 14 : 3 - wire interface . write command when cnt=0 figure 15 : 3 - wire interface . write command when hiz=1 and wfr=1 1.5.15 spi slave port the slave spi port communicates directly with the mpu data bus and is abl e to read and write data ram locations . it is also able to send commands to the mpu . the interface to the slave port consists of the pcsz, pclk, psdi and psdo pins . these pins are multiplexed with the lcd segment driver pins seg3 to seg6 . the port pins default to lcd driver pins . the port is enabled by setting the spe bit . a typical spi transaction is as follows . while pcsz is high, the port is held in an initialized/reset state . during this state, psdo is held in hiz state and all transitions on pclk and psdi are ignored . when pcsz falls, the port will begin the transaction on the first rising edge of pclk . a transaction consists of an 8 - bit command, a 16 - bit address and then one or more bytes of data . the transaction ends when pcsz is raised . some transactions may consist of a command only . the last spi command and address (if part of the command) are available to the mpu in registers sp_cmd and sp_addr . the spi port supports data transfers at 1 mb/s in mission mode and 16 kb/s in brownout mode . the spi commands are described in table 49 and in figure 16 illustrate the spi interface read and write ti m- ing. cnt cycles (8 shown) read d0 d1 d2 d3 d4 d5 int5 d6 d7 eectrl byte written sclk (output) busy (bit) sdata (input) sdata output z (hiz) cnt cycles (0 shown) write -- no hiz d7 int5 not issued cnt cycles (0 shown) write -- hiz int5 not issued eectrl byte written eectrl byte written sclk (output) busy (bit) sdata (output) sclk (output) busy (bit) sdata (output) (hiz) sdata output z sdata output z (loz) cnt cycles (6 shown) write -- with hiz and wfr eectrl byte written sclk (output) busy (bit) sdata (out/in) d2 d3 d4 d5 d6 d7 busy ready (from eeprom) int5 (from 6520) sdata output z (hiz) (loz) downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 50 rev 2 table 49 : spi c ommand description command description 11xx xxxx addr byte0 ... byten read data starting at addr. the addr will auto - increment until pcsz is raised. upon completion: sp__ cmd =11xx xxxx, sp_ addr =addr+n+1 . no mpu interrupt is generated if the command is 1100 0000. otherwise , an spi interrupt is generated. 10xx xxxx addr byte0 ... byten write data starting at addr. the addr will auto - increment until pcsz is raised. up on completion: sp_ cmd =10xx xxxx, sp_ addr =addr+n+1 . no mpu interrupt is generated if the command is 1000 0000. otherwise, an spi interrupt is generated. certain i/o ram registers can be written and read using the spi port (see table 50 ) . however, the mpu takes priority over the i/o ram bus, and spi operation may fail without notice. to avoid this situation, the spi host should send a command other than 11xxxxxx or 10xxxxxx (read or writ e) before the actual read or write command. the spi slave interface will load the command register an d generate an int2 inte r- rupt upon receiving the command. the mpu should service the interrupt and halt any external dat a memory operations to effectively grant the bus to the spi. when the spi host finishes , it should send another command so the mpu can release the bus. there are no issues with data ram access; spi and the mpu will share the bus with no conflicts for data ram access. table 50 : i/o ram registers accessible via spi name address (hex) bit range read/write ce0 2000 7:3 rw ce1 2001 7:0 rw ce2 2002 5:3, 1:0 rw config0 2004 7:6, 3 :0 rw config1 2005 5:2, 0 rw version 2006 7:0 r config2 2007 7:0 rw dio0 2008 7 :6 , 4:0 rw dio1 to dio6 2009 to 200e 6:4, 2:0 rw ? 200f 7:6, 3:2 rw rtm0h 2060 1:0 rw rtm0l 2061 7:0 rw rtm1h 2062 1:0 rw rtm1l 2063 7:0 rw rtm2h 2064 1:0 rw rtm2l 2065 7:0 rw rtm3h 2066 1:0 rw rtm3l 2067 7:0 rw pls_w 2080 7:0 rw pls_i 2081 7:0 rw slot0 to slot9 2090 to 209a 7:0 rw ce3 209d 3:0 rw ce4 20a7 7:0 rw ce5 20a8 7:0 rw wake 20a9 7:5, 3:0 r config3 20ac 5:4, 1 :0 rw config4 20ad 5:4, 1 :0 rw ? 20af 2:0 rw downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 51 name address (hex) bit range read/write spi0 20b0 4, 0 rw spi1 20b1 4, 0 r version 20c8 7:0 r chip_id 20c9 7:0 r trimsel 20fd 4:0 rw trimx 20fe 0 rw trim 20ff 7:0 rw a15 a14 a1 a0 c0 0 31 x d7 d6 d1 d0 d7 d6 d1 d0 c5 c6 c7 x pcsz psck psdi psdo 8 bit cmd 16 bit address data[addr] data[addr+1] 7 8 23 24 32 39 extended read . . . serial read a15 a14 a1 a0 c0 0 31 c5 c6 c7 x pcsz psck psdi psdo 8 bit cmd 16 bit address data[addr] data[addr+1] 7 8 23 24 32 39 extended write . . . serial write d7 d6 d1 d0 d7 d6 d1 d0 x hi z hi z (from host) (from 6531) (from host) (from 6531) figure 16 : spi slave port : typical r ead and w rite operations possible applications for the spi interface are: 1) an external host reads data from ce locations to obtain metering information. this can be used in applications where the 71m6531 d/f or 71m6532d/f function as smart front - end s with preprocessing capability. since the addresses are in 16 - bit format, any type of xram data can be accessed: ce, mpu, i/o ram, but not sfrs or the 80515 - internal register bank. 2) a communication link can be established via the spi interface: by wr iting into mpu memory locations, the external host can initiate and control processes in the mpu of the 71m6531 d/f or 71m6532d/f . writing to a ce or mpu location normally generates an interrupt, a func tion that can be used to signal to the mpu that the byte that had just been written by the external host must be read and processed. data can also be inserted by the external host without generating an interrupt. 3) an external dsp can access front - end data generated by the adc. this mode of operation uses the 71m6531 d/f or 71m6532d/f as an analog front - end (afe). downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 52 rev 2 v3p3 v3p3 - 400mv v3p3 - 10mv vbias 0v battery modes normal operation, wdt enabled wdt dis- abled v1 1.5.16 hardware watchdog timer a n independent, robust, fixed - duration, watchdog timer (wdt) is included in the 71m6531d/f and 71m6532d/f . it uses the rtc crystal oscillator as its time base and must be refreshed by the mpu fir m ware at least every 1.5 seconds . when not refreshed on time, the wdt overflows and the part is reset as if the reset pin were pulled high, except that the i/o r am bits will be in the same state as after a wake - up from sleep or lcd modes (see the i/o ram description in section 4.2 for a list of i/o ram bit states after reset and wake - up) . 4100 oscillator cycles (or 125 ms) after the wdt overflow, the mpu will be launched from program address 0x0000. a status bit, wd_ovf, is set when the wdt overflow occurs . this bit is preserved in lcd mode (not in sleep mode) and can be read by the mpu when wake rises to determine if the part is initializing after a wdt ove r- flow event or after a power - up . after it is read, the mpu firmware must clear wd_ovf . the wd_ovf bit is also cleared by the reset pin . there is no internal digital state that deactivates the wdt. figure 17 : functions defined by v1 t he wdt can be disabled by tying the v1 pin to v3p3 (see figure 17 ) . of course, this also deact ivates v1 power fault detection . since there is no method in firmware to disable the crystal oscillator or t he wdt, it is guaranteed that whatever state the part might find itself in, upon watchdog overflow, the part will be reset to a known state. assert ing ice_e will also deactivate the wdt . this is the only method that will work in brownout mode . in normal operation, the wdt is reset by periodically writing a one to t he wdt_rst bit . the watchdog timer is also reset when the internal signal wake = 0 ( see section 2.5 wake - up behavior ). if enabled with the ien_wd_nrovf bit in i/o ram, an interrupt occurs roughly 1 ms before the wdt resets the chip . this can be used to determine the cause of a wdt reset since it allows the code to log its state (e.g. the current pc value, loop counters, flags, etc.) before a wdt r eset occurs. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 53 1.5.17 test ports (tmuxout pin) on e of the digital or analog signals listed in table 51 can be selected to be output on the tmuxout pin . the function of the multiplexer is controlled with the i/o ram field tmux [4:0] (0x20aa [4:0]), as shown in table 51 . table 51 : tmux[4:0] selections tmux[4:0] mode function 0 analog gndd 1 analog reserved 2 analog gndd 3 analog reserved 4 analog pll_2p5 5 analog output of the 2.5 v low - power regulator 6 analog internal vbias voltage (nominally 1.6v) 7 analog not used 8 - 0x0f C reserved 0x10 digital rtc 1 - second output 0x11 digital rtc 4 - second output 0x12 C not used 0x13 digital v1_ok comparator output 0x14 digital real - time output (rtm) from the ce 0x15 digital wdtr_en (comparator 1 output and v1lt3) 0x16 C 0x17 C not used 0x18 digital rxd (from optical interface, w/ optional inversion) 0x19 digital mux_sync 0x1a C not used 0x1b digital ckmpu (mpu clock) 0x1c digital pulse output 0x1d digital rtclk (output of the oscillator circuit, nominally 32,786hz) 0x1e digital ce_busy (busy interrupt generated by ce, 396s) 0x1f digital xfer_busy (transfer busy interrupt generated by the ce, nominally every 999.7ms) the tmuxout pin may be used for diagnosis purposes or in production test . the rtc 1 - second output may be used to calibrate the crystal oscillator . the rtc 4 - second output provides even higher precision. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 54 rev 2 2 f unctional d escription 2.1 theory of o peration the energy delivered by a power source into a load can be expressed as: = t dt tit v e 0 )( )( assuming phase angles are constant, the following formulae apply: ? p = real energy [wh] = v * a * cos * t ? q = reactive energy [varh] = v * a * sin * t ? s = apparent energy [vah] = 2 2 q p + for a practical meter, not only voltage and current amplitudes, but als o phase angles and harmonic content may change constantly . thus, simple rms measurements are inherently inaccurate . a modern solid - state electricity meter ic such as the 71m6531 functions by emulating the integra l operation above, i.e. it pr o- cesses current and voltage samples through an adc at a constant frequency . as long as the adc resol u- tion is high enough and the sample frequency is beyond the harmonic range of interest, the current and voltage samples, multiplied with the time period of sampling will yi eld an accurate quantity for the mome n- tary energy . summing up the momentary energy quantities over time will result in acc umulated energy. figure 18 : voltage , current, momentary and accumulated energy figure 18 shows the shapes of v(t), i(t), t he momentary power and the accumulated power, resulting from 50 samples of the voltage and current signals over a period of 20 ms . the application of 240 vac and 100 a results in an accumulation of 480 ws (= 0.133 wh) over the 20 ms period, as indicated by the a ccumulated p ower curve . the described sampling method works reliably, even in the presence of dynam ic phase shift and harmonic distortion. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 55 2.2 system timing summary figure 19 s ummarizes the timing relationships between the input mux states, the ce_busy signal and the two serial output streams . in this example, mux_div[3:0] = 4 and fir_len[1:0] = 2 (384 ce cycles , 3 ck32 cycles per conversion ) , resulting in 13 ck32 cycles per multiplexer frame . generally, t he duration of each mux frame is : ? 1 + mux_div * 1 , if fir_len[1:0] = 0 (138 ce cycles) ? 1 + mux_div * 2 , if fir_len[1:0] = 1 (288 ce cycles) ? 1 + mux_div * 3 , if fir_len[1:0] = 2 (384 ce cycles) . an adc conversion will always consume an integer number of ck32 clocks . following this is a single ck32 cycle where the bandgap voltage is allowed to recover from the change in cross. figure 19 : timing relationship between adc mux, compute engine each ce program pass begins when the adc0 conversion (for ia) begins. dependi ng on the length of the ce program, it may continue running until the end of the last conversi on ( adc 3 ). ce opcodes are constructed to ensure that all ce code passes consume exactly the same number of cycles. the result of each adc conversion is inserted into the ram when the conversion is complet e. the ce code is written to tolerate sudden changes in adc data. the exact clock coun t when each adc value is loaded into ram is shown in figure 19 . figure 20 shows that the serial data stream, rtm, begins transmitting at the begi nning of state s. rtm, consisting of 140 ck cycles, will always finish before the next code pass starts. flag rtm data 0 (32 bits) 0 1 0 1 0 1 0 1 flag flag flag ck32 mux_sync cktest tmuxout/rtm lsb lsb sign sign lsb sign 30 31 30 31 30 31 30 31 lsb sign rtm data 1 (32 bits)rtm data 2 (32 bits) rtm data 3 (32 bits) figure 20 : rtm output format ck32 mux state 0 mux_div =4 (4 conversions) is shown settle adc mux frame adc execution s mux_sync s ce_execution max ck count 0 450 150 900 1350 1800 adc0 adc1 adc2 adc3 ck count = ce_cycles + floor((ce_cycles + 2) / 5) notes: 1. all dimensions are 5mhz ck counts. 2. the precise frequency of ck is 150*crystal frequency = 4.9152mhz. 3. xfer_busy occurs once every ( pre_samps * sum_cycles ) code passes. ce_busy xfer_busy initiated by a ce opcode at end of summation interval adc timing ce timing 1 2 3 downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 56 rev 2 2.3 battery modes shortly after system power (v3p3sys) is applied, the part will be in mission mode . mission mode means that the part is operating with system power and that the internal pll is stable . this mode is the normal operation mode where the part is capable of measuring energy. when system power is not available (i.e. when v1 vbias v1 <= vbias lcd_only reset & vbat_ok reset ie_pllrise ie_pllfall ie_pb ie_wake pb timer timer pb reset & v3p3sys rises v3p3sys rises vbat_ok vbat_ok vbat_ok vbat_ok sleep downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 57 to facilitate transition to sleep mode, which is useful when an unprogrammed ic is mounted on a pcb with a battery installed, the production test programs the following six - byte sequence into the flash loc a- tion starting at address 0x00000: 0x74 - 0x40 - 0x90 - 0x20 - 0xa9 - 0xf0. this sequence decodes to the following assembler code: 0000: 7440 mov a,#40 ; set bit 6 in accumulator 0 002: 9020a9 mov dptr,#20a9 ; point to i/o ram address 0x20a9 0005: f0 movx @dptr,a ; set bit 6 (sleep) in 0x20a9 transitions from both lcd and sleep mode are initiated by the wake - up timer timeout conditions or pushbutton events . when the pb pin is pulled high (pushbutton is pressed), the ie_pb interrupt flag (sfr 0xe8[4]) is set, and when the wake - up timer times out, the ie_wake interrupt flag (sfr 0xe8[5]) is set. in the absence of system power, if the voltage margin for the ldo regulator providing 2.5 v to the internal circuitry becomes too low to be safe, the part automatically enters sleep mode (bat_ok false) . the ba t- tery voltage must stay above 3 v to ensure that bat_ok remains true . under this condition, the 71m6531 stays in sleep mode, even if the voltage margin for the ldo improves ( bat_ok true). table 52 shows the circuit functions available in each operating mode. table 52 : available circuit functions circuit function system power battery power (nonvolatile supply) mission brownout lcd sleep ce yes C C C ce data ram yes yes C C fir yes C C C analog circuits yes C C C mpu clock rate from pll, as defined by mpu_div[2:0] 28.672 khz (7/8 of 32768 hz) C C mpu_div[2:0] yes C C C ice yes yes C C dio pins yes yes C C watchdog timer yes yes C C lcd yes yes yes C eeprom interface (2 - wire) yes yes (8 kb/s) C C eeprom interface (3 - wire) yes yes (16 kb/s) C C uart yes 300 bd C C optical tx modulation yes C C C flash read yes yes C C flash page erase yes yes C C flash write yes C C C ram read and write yes yes C C wakeup timer yes yes yes yes osc and rtc yes yes yes yes x ram data preservation yes yes C C v3p3d voltage output pin yes yes C C gpo C gp7 registers yes yes yes yes C indicates not active 2.3.1 brownout mode in brownout mode, most non - metering digital functions are active (as shown in table 52 ), i ncluding ice, uart, eeprom, lcd and rtc . in brown out mode, a low bias current regulator will provide 2.5 volts to v2p5 and v2p5nv . the regulator has an output called bat_ok to indicate that it has suf ficient overhead . when bat_ok = 0, the part will enter sleep mode . from brownout mode, the processor downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 58 rev 2 can voluntarily enter lcd or sleep modes . when system power is restored, the part will automatically transition from any of the battery modes to mission mode, once the pll has settled. the mpu will run at 7/8 of the c rystal clock rate . this permits the uarts to be operated at 300 bd . in this mode, the mpu clock has substantial short - term jitter. the value of mpu_div[2:0] will be reme mbered (not changed) as the part enters and exits brownout . mpu_div[2:0] will be ignored during brownout. while pll_ok = 0, the i/o ram bits adc_e and ce_e are held in the zero state disabling both the adc and the ce . when pll_ok falls, the ce program counter is cleared immediately and all fir process ing halts . 2.3.2 lcd mode in lcd mode, the data contained in the lcd_segn[3:0] fields is displayed . u p to four lcd segments , each connected to pin s seg18 and seg19 , can be made to blink without the involvement of the mpu, which is disabled in lcd mode. to minimize power, only segments that might be used should be en a- bled. lcd mode can be exited only by system power up, a timeout of the wake - up timer, or a push button. when the ic exit s lcd mode, the mpu can discover the event that caused the exit by reading the interrupt flags and interpret them as follows: ? ie_wake = 1 indicates that the wake timer has expired. ? ie_pb =1 indicates that the pushbutton input (pb) was activated. ? compstat = 0 indicates that a reset occurred but that main power is not yet available. ? if none of the above conditions applies , system power (v3p3sys) must have been restored after the transition from lcd mode to mission or brownout mode, the pc will be at 0x0000, the xram is in an undefined state and the i/o ram is only partially preserved (see the description of i/o r am states in section 4.2 ). the gp 0 [ 7:0] through gp7 [7:0] registers are preserved unless reset goes high. 2.3.3 sleep mode in sleep mode, the battery current is minimized and only the oscillator and rtc functions are active . this mode can be exited only by system power - up, a timeout of the wake - up timer, or a push button event . when the ic exits sleep mode, the mpu can discover the event that caused the exit by reading the interrupt flags and interpret them as follows: ? ie_wake = 1 indicates that the wake timer has expired. ? ie_pb =1 indicat es that the pushbutton input (pb) was activated. ? compstat = 0 indicates that a reset occurred but that main power is not yet available. ? if none of the above conditions applies , system power (v3p3sys) must have been restored after the transition from sleep mode to mission or brownout mode the pc will be at 0x0000, the xram is in an undefined state and the i/o ram is only partially preserved (see the description of i/o r am states in section 4.2 ). the gp0[7:0] through gp7 [7:0] registers are preserved unless reset goes high. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 59 figure 22 : transition from brownout to mission mode when system p ower returns figure 23 : power - up timing with v3p3sys and vbat tied together downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 60 rev 2 figure 24 : power - up timing with vbat only 2.4 fault and reset behavior 2.4.1 reset mode when the reset pin is pulled high, all digital activity stops . the oscillator and rtc module continue to run . additionally, all i/o ram bits are set to their default states . as long as v1, the input voltage at the power fault block, is greater than vbias, the internal 2.5 v regulator will continue to provide power to the digital section. once initiated, the reset mode will persist until the reset timer tim es out, signified by wake rising . this will occur in 4100 cycles of the real time clock after reset goes lo w, at which time the mpu will begin executing it s pre - boot and boot sequences from address 00 . see the program security description in the flash memory section for additional description s of pre - boot and boot. if system power is not present, the reset timer duration will be 2 cycl es of the crystal clock at which time the mpu will begin execu ting in brownout mode, starting at address 00. 2.4.2 power fault circuit the 71m6531 d/ f and 71m6532d/f include a comparator to monitor system power fault conditions . when the output of the comparator falls (v1 fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 61 2.5 wake - up behavior as described above, the part will always wake up in mission mode when system power is restored . ad ditionally, the part will wake up in brownout mode when pb rises (pus h button is pressed) or when a time out of the wake - up timer occurs. 2.5.1 wake on pb if the part is in sleep or lcd mode, it can be awakened by a rising edge on the p b pin . this pin is nor mally pulled to gnd and can be pulled high by a push button depression . before the pb signal rises, the mpu is in reset due to wake being l ow . when pb rises, wake rises and within three crystal cycles, the mpu begins to execute . the mpu can determine whether the pb signal woke it up by checking the ie_pb flag . figure 25 shows the wake up timing. for debouncing, the pb pin is monitored by a state machine operating from a 32 hz clock . this circuit will reject between 31 ms and 62 ms of noise . detection hardware will ignore all transitio ns after the initial rising edge . this will continue until the mpu clears the ie_pb bit. figure 25 : wake up timing 2.5.2 wake on timer if the part is in sleep or lcd mode, it can be awakened by the wake - up timer . until this timer times out, the mpu is in reset due to wake being low . when the wake - up timer times out, the wake signal rises and within three crystal cycles, the mpu begins to execute . the mpu can determine whether the timer woke it by checking the autowake interrupt f lag ( ie_wake ). the wake - up timer begins timing when the part enters lcd or sleep mode . its duration is controlled by wake_prd[2:0] and wake_res . wake_res selects a timer lsb of either 1 minute ( wake_res = 1) or 2.5 seconds ( wake_res = 0) . wake_prd[2:0] selects a duration of from 1 to 7 lsbs. the timer is armed by wake_arm = 1 . it must be armed at least three rtc cycles before sleep or lcd_only is initiated . setting wake_arm presets the timer with the values in wake_res and wake_prd and readies the timer to start when the pro cessor writes to sleep or lcd_only . the timer is reset and disarmed whenever the processor is awake . thus, if it is de sired to wake the mpu periodically (every 5 seconds, for example) the timer must be rearmed every time the mpu is awakened. 2.6 data flow the data flow between the compute engine ( ce ) and the mpu is shown in figure 26. in a typical a p- plication , the 32 - bit ce se quen tially processes the samples from the voltage inputs on pins ia, va, ib and vb, performing calculations to measure active power (wh), reactive power (varh), a 2 h and v 2 h for four - quadrant metering. these measurements are then accessed by the mpu, processed further an d output using the peripheral devices available to the mpu. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 62 rev 2 figure 26 illustrates the ce/mpu data flow. figure 26 : mpu/ce data flow 2.7 ce/mpu communication figure 27 shows the functional relation ship s between the ce and the mpu . the ce is controlled by the mpu via shared registers in the i/o ram and in ram . the ce outputs two interrupt signals to the mpu: ce_busy and xfer_ busy, which are connected to the mpu interrupt service inputs as external interrupts. ce_busy indicates that the ce is actively pr o- cessing data . this signal will occur once every multiplexer cycle . xfer_busy indicates that the ce is updating data to the output region of the ram . this will occur whenever the ce has finished generating a sum by completing an accumulation interval determined by sum_cycles[5:0] * pre_samps[1:0] samples . interrupts to the mpu occur on the falling edges of the xfer_busy and ce_busy signals. refer to section 4.3 ce interface description for additional information on setting up the device using the mpu firmware. varsum wsum apulsew apulser ext pulse sag control data dio xfer busy samples ce mpu interrupts i/o ram (configuration ram) mux control adc display (memory mapped lcd segments) serial (uart0/1) eeprom (i 2 c) var (dio7) pulses w (dio6) ce busy figure 27 : mpu/ce communication ce mpu pre - processor post - processor irq processed metering data pulses i/o ram (configuration ram) samples data downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 63 3 a pplication i nformation 3.1 connection of sensors figure 28 through figure 30 show how resistive dividers, current transformers, rogowski co ils and res istive shunts are connected to the voltage and current inputs of the 71m6531. the analog input pins of the 71m65xx are designed for sensors with low source im pedance. rc filters with resistance values higher than those implemented in the demo boards should be avoided. see a p plication note an5292 for details on filter implementation. figure 28 : resistive voltage divider figure 29 : ct with single ended (left) and differential input (right) connection figure 30 : resistive shunt (left) and rogowski sensor (right) connection note: ferrites or other inductive components must not be connected directly t o the sensor input pins (inp, inn, vn). 3.2 connecting 5 - v devices all digital input pins of the 71m6531 d/ f and 71m6532d/f are compatible with external 5 - v devices. i/o pins configured as inputs do not require current - limiting resistors when t hey are connected to external 5 v de vices. v out r 1/n i in i out filter v3p3 ia inp inn v3p3a v out i out i in r 1/n v diff v out r i in ia v3p3 vout = c* di in / dt v out 1/n i in ian iap v3p3a downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 64 rev 2 3.3 temperature measurement measureme nt of absolute temperature uses the on - chip temperature sensor and applying the following formula: n n n t s n t n t + ? = ) )( ( in the above formula , t is the temperature in c, n( t ) is the adc count at temperature t , n n is the adc count at 25c, s n is the sensitivity in lsb/c as stated in the electrical specif ications and t n is +25 c . it is recommended that temperature measurements be based on temp_raw_x which is the sum of two consecutive temperature readings , thus being higher by a factor of two than the raw sensor readings. 3.4 temperature compensation 3.4.1 temperature coefficients: the internal voltage reference vref is calibrated during device manufacture. t he temperature coefficient tc2 is given as a constant that represent s typical com ponent behavior (in v/c 2 ). tc1 (v/c) can be calculated for the individual chip from the contents of the trimt [7:0] i/o ram register. tc1 and tc2 allow compensation for variations of the reference voltage to withi n 40 ppm/c. since tc1 and tc2 are given in v/c and v/c 2 , respectively, the value of the vref voltage (1.195v) has to be taken into account when transitioning to ppm/c and ppm/c 2 . this means that ppmc = 26.84*tc1/1.195 and ppmc2 = 1374*tc2/1.195). close examination of the electrical specification (see table 53 ) reveals that the achievable deviation is not strictly 40 ppm/c over the whole temperature range: only for temperatures for which t - 22 > 40 (i. e. t > 62c) or for which t - 22 < - 40 ( i.e. t < - 18c), the data sheet states 40 ppm/c. for temperatures between - 18c and +62c, the error should be considered constant at 1,600 ppm, or 0.16%. p arameter c ondition m in t yp vref(t) deviation from vnom(t) )40,22 max( 10 )( )( )( 6 ? ? t t vnom t vnom t vref - 40 +40 ppm/oc table 53 : vref definition for 65 31 figure 31 shows this concept graphically. the box from - 18c to +62c reflects the fact that it is impra c- tical to measure the temperature coefficient of high - quality references at small temperature e xcursions. for example, at +25c, the expected error would be 3c * 40 ppm/c, or just 0.012 %. the maximum deviation of 25 20 ppm (or 0.252%) is reached at the temperature extremes. if the refe r- ence voltage is used to measure both voltage and current, the identic al errors of 0.252% add up to a maximum wh registration error of 0.504 %. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 65 figure 31 : error band for vref over temperature 3.4.2 temperature compensation for vref the bandgap temperature is used to digitally compensate the power outputs for the temperature dependence of vref, using the ce register gain_adj . since the band gap amplifier is chopper - stabilized, the most significant long - term drift mechanism in the voltage reference is removed. the following formula is used to determine the gain_adj value of the ce . in this formula , temp_x is the deviation from nominal or calibration temperature expressed in multiples of 0.1 c: 23 2 14 2 2 _ 2 _ 16385 _ ppmc x temp ppmc x temp adj gain ? + ? + = 3.4.3 system temperature compensat i on in a production electricity meter, the 71m6531 or 71m6532d/f is not the only component contributing to temperature dependency. a whole range of components (e.g. current transformers, resistor dividers, power sources, filter capacitors) will contribute temperature effects. since the output of the on - chip temperature sensor is accessible to the mpu, temperature compensation mechanisms with great flexibility are possible . mpu access to gain_adj permits a system - wide temperature correction over the entire meter rather than local to the chip. 3.4.4 temperature compensation for the rtc in order to obtain accurate readings from the rtc, the following procedure is r ecommended: 1. at the time of meter calibration, the crystal oscillator may be calibrated using the rtc a _adj register in i/o ram to be as close to 32768 hz as possible . the recommended procedure is to connect a high - precision frequency counter to the tmuxout pin and select 0x11 for tmux[4:0] . this will ge n- erate a 4 - second pulse at tmuxout that can be used to trim rtc a _adj to the best value. a wider trim range is achieved with the i/o ram registers preg[16:0] and qreg[1:0] . 2. when the meter is in service, the mpu takes frequent temperature readings . if the temperature cha racteristics of the crystal are known, the temperature readings can be used to modify the settings for the i/o ram registers preg[16:0] and qreg[1:0] in order to keep the crystal frequency close to 32768 hz. 3. after periods of operation under battery power, the temperature for the time the meter was not powered can be estimated by averaging the temperatures before and after battery operation . based on this, the overall correction for the rtc time can be calculated and applied to the rtc after main power returns downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 66 rev 2 to the meter. 3.5 connecting lcds the 71m6531 d/ f and 71m6532d/f ha ve an on - chip lcd controller capable of controlling static or multiplexed lcds. figure 32 shows the basic connection for an lcd. the following dedicated and multi - use pins can be assigned as lcd segment pins for the 71m6531d/f : ? 12 dedicated lcd segment pins: seg0 to seg2, seg7, seg8, seg12 to seg18 . ? 7 dual - function pins: seg3/pclk, seg4/psdo, seg5/pcsz, seg6/psdi, e_rx tx/seg9, e_tclk/seg10, and e_rst/seg11. ? 14 combined dio and segment pins: seg24/dio4 to seg35/dio15, seg37/dio17, seg48/dio28, seg49/dio29 and seg63/dio43 to seg66/dio46. the following dedicated and multi - use pins can be assigned as lcd segments for the 71m6532d/f : ? 15 dedicated lcd segment pi ns: seg0 to seg2, seg8, seg12 - seg18, seg20 - seg23. ? 9 dua l- function pins: mux_sync/seg7, e_rxtx/seg9, e_tclk/seg10, e_rst/seg11, seg3/pclk, seg4/psdo, seg5/pcsz, seg6/psdi. ? 43 combined dio and segment pins, as described in section 1.5.8 . . figure 32 : connecting lcds 3.6 connecting i 2 c eeproms i 2 c eeproms or other i 2 c compatible devices should be connected to the dio pins dio4 and dio5, as shown in figure 33 . pull - up resistors of roughly 10 k ? to v3p3d (to ensure operation in brownout mode) should be used for both scl and sda signals. the dio_e ex[1:0] register in i/o ram must be set to 01 in order to convert the dio pins dio4 and dio5 to i 2 c pins scl and sda. figure 33 : i 2 c eeprom connection dio4 dio5 71m6531d/f 71m6532d/f eeprom scl sda v3p3d 10 k 10 k segments 71m6531d/f or 71m 6532d/f lcd commons downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 67 3.7 connecting three - wire eeproms wire eeproms and other compatible devices should be connected to the dio pi ns dio4 and dio5, as shown in figure 34 and described b elow: ? dio5 connects to both the di and do pins of the three - wire device. ? the cs pin must be connected to a vacant dio pin of the 71m6531. ? in order to prevent bus contention, a 10 k ? to resistor is used to separate the di and do signals. ? the cs and clk pins should be pulled down with resistors to prevent operation of the thr ee - wire device on power - up, before the 71m6531 can establish a stable signal for cs and clk . ? the dio_eex[1:0] register in i/o ram must be set to 2 (b 10 ) in order to convert the dio pins dio4 and dio5 to wire pins. the - wire eeprom interface is only functional when mpu_div[2:0] = 000. figure 34 : three - wire eeprom connection 3.8 uart0 (tx/rx) the uart0 rx pin should be pulled down by a 10 k ? resistor and additionally protected by a 100 pf ceram ic capacitor, as shown in figure 35 . figure 35 : connections for uart0 3.9 optical interface (uart1) the opt_tx and opt_rx pins can be used for a regular serial interface ( by connecting a rs - 232 tran sceiver for example), or they can be used to directly operate optical components (for example, an infrared diode and phototransistor implementing a flag interface ) . figure 36 shows the basic connections for uart1 . the opt_tx pin becomes active when the i/o ram register opt_txe is set to 0 0. tx rx 71m6531d/f, 71m6532d/f 10 k 100 pf rx tx 71m653x eeprom 100 k? dio4 dio5 clk di v3p3d 100 k? cs dion do 10 k ? vcc downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 68 rev 2 the polarity of the opt_tx and opt_rx pins can be inverted with the configuration bits , opt_txinv and opt_rxinv , re spectively . the opt_tx output may be modulated at 38 khz when system power is present . modulation is not available in brownout mode . the opt_txmod bit enables modulation . the duty cycle is controlled by opt_fdc[1:0] , which can select 50%, 25%, 12.5% and 6.25% duty cycle . a 6.25% duty cycle means opt_tx is low for 6.25% of the period. the opt_rx pin uses digital signal thresholds. it may need an analog filter when receiving modulated optical signals. with modulation, an optical emitter can be operated at higher current than nominal , enabling it to increase the distance along the optical path. if operation in brownout mode is desired, the external components should be connected to v3p3d. figure 36 : connection for optical components 3.10 connecting the v1 pin a voltage divider should be used to establish that v1 is in a safe range wh en the meter is in mission mode (see figure 37 ) . v1 must be lower than 2.9 v in all cases in order to keep the hardware watchdog timer enabled . the resistor divider ratio must be chosen so that v1 crosses the vbias thr eshold when v3p3 is near the minimum supply voltage (3.0 vdc). a series r esistor (r3) provides additional hysteresis, and a capacitor to ground (c1) is added for enhanced emc immunity . the amount of hysteresis depends on the choice of r1 and r3: if v1 < vbias, approximately 1 a will flow into the on - chip v1 comparator causing a voltage drop. if v1 vbias, almost no current will flow into the comparator. the voltage drop will require v3p3 to be slightly higher for v1 to cross the vbi as threshold when v3p3 is rising as compared to when v3p3 is falling. maintaini ng sufficient hysteresis helps to eliminate rapid mode changes which may occur in cases where the power s upply is unstable with v1 close to the vbias threshold point. figure 37 : voltage divider for v1 opt_tx r 2 r 1 opt_rx 71m6531d/f or 71m6532d/f v3p3sys phototransistor led 10 k? 100 pf v3p3sys downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 69 3.11 connecting the reset pin even though a functional meter will not necessarily need a reset switch, it is useful to have a reset push - button for prototyping as shown in figure 38 , left side. the reset signal may be sourced from v3p3sys (functional in mission mode only), v3p3d (mission and brownout modes), or vbat (all modes, if a battery is present), or from a combination of these sources, depending on the application. for a production meter, the reset pin should be protected by the by the externa l components shown in figure 38 , right side. r1 should be in the range of 100 ? and mounted as closely as possible to the ic. figure 38 : external components for the reset pin: push - button (left), production circuit (right) since the 71m6531 generates its own power - on reset, a reset button or circuitry, as shown in figure 38 , is only required for test units and prototypes. 3.12 connecting the emulator port pins even when the emulator is not used, small shunt capacitors to ground (22 pf) should be used for protection from emi as illustrated in figure 39 . production boards should have the ice_e pin connected to ground . figure 39 : external components for the emulator interface 3.13 connecting a battery it is important that a valid voltage is connected to the vbat pin at al l times. for meters without a battery, vbat should be connected directly to v3p3sys. designs for meters with b atteries need to ensure that the meter functions even when the battery voltage decreases below the specified voltage for vbat. this can be achieved by connecting a diode from v3p3sys to vbat. howev er, the battery test will yield in accurate results if that technique is used, since the voltage at v3p3sys w ill feed current to t he vbat pin. a better solution is shown in figure 40 : during the battery test, a dio pin is activated as an output and applies a low voltage to the anode of the diode . this prevents the voltage at the power supply to i n- fluence the voltage at the vbat pin. e_rst 71m6531d/f 71m 6532d/f e_tclk 62 62 ? 62 ? 22 pf 22 pf 22 pf lcd segments ice_e v3p3d e_rxt (optional) r 1 reset gndd v3p3d r 2 vbat/ v3p3d reset switch 1k ? 0.1f 10k ? 71m6531d/f 71m6532d/f 71m6531 d/f 71m 6532d/f downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 70 rev 2 figure 40 : connecting a battery as mentioned in section 2.3 , meters equipped with batteries need to contain code that transitions the chip to sleep mode as soon as the battery is attached in production. otherwise, remaining in brownout mode would add unnecessary drain to the battery. 3.14 flash progra mming operational or test code can be programmed into the flash memory using either an in - circuit emulator or th e flash programmer module (tfp2) available from maxim . the flash programming procedure uses the e_rst, e_rxtx and e_tclk pins. the fl_bank[ 2:0] register must be set to the value corresponding to the bank that is being programmed. 3.15 mpu firmware all application - specific mpu functions mentioned in the application information section are featured in the demonstration source code supplied by maxim . the code is available as part of the demonstration kit for the 71m6531 d/f and 71m6532d/f . the demonstration kits come with the 71m6531 d/ f or 71m6532d/f pre programmed with demo firmware and mounted on a functional sample meter demo board. the demo boards allow for quick and efficient evaluation of the ic without having to wri te firmware or having to su p- ply an in - circui t emulator (ice). 3.16 crystal oscillator the oscillator drives a standard 32.768 khz watch crystal . the oscillator has been designed specifically to handle these crystals and is compatible with their high impedance and limited power handling capability . the oscillator power dissipation is very low to maximize the lifeti me of any battery backup device attached to vbat. board layouts with minimum capacitance from xin to xout will requ ire less battery current . good la y- outs will have xin and xout shielded from each other. for best rejection of electromagnetic interference, connect the crystal body and the ground ter minals of the two crystal capacitors to gndd through a ferrite bead . no external resistor should be connected across the crystal, since the oscill ator is self - biasing. 71m6531/71m6532 v3p3a dio power supply v3p3sys vb at battery or super - cap + - downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d/f rev 2 71 3.17 meter calibration once the 71m6531 d/ f or 71m6532d/f energy meter device has been installed in a meter system, it must be calibrated . a complete calibration includes the following: ? calibration of the metrology section, i.e. calibration for tolerances of the curr ent sensors, voltage dividers and signal conditioning components as well as of the internal reference voltage (vr ef). ? establishment of the reference temperature ( section 3.3 ) for temperature measurement and temperature compensation ( section 3.4 ) . ? calibrati on of the battery voltage measurement ( section 1.5.13 ). ? calibration of the oscillator frequency ( section 1 .5.3 ) and temperature compensation for the rtc ( section 3.4.4 ). the metrology section can be calibrated using the gain and phase adjustment factors accessible to the ce . the gain adjust ment is used to compensate for tolerances of components used for signal condi tioning, especially the resistive components . phase adjustment is pro vided to compensate for phase shifts introduced by the current sensors or by the effects of reactive power supplies . due to the flexibility of the mpu firmware, any calibration method, such as calibration based on energy, or current and voltage can be impl emented . it is also possible to implement segment - wise calibration (depending on current range). the 71m6531 d/ f and 71m6532d/f support common industry standard calibration techniques, such as sin gle - point (energy - only) , multi - point (energy, vrms, irms) and auto - calibration. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 72 rev 2 4 f irmware i nterface 4.1 i/o ram and sfr map C functional order in table 54 , unimplemented (u) and reserved (r) bits are shaded in light gray. unimplemented bits have no memory storage, writing them has no effect, and reading them always returns zero. reserved bits may be in use and should not be changed from the values given in parentheses. writing values other than those shown in parenthesis to reserved bits may have undesirable side effects and must be avoided. non - volatile bits are shaded in dark gray. non - vo latile bits are backed - up during power failures if the system includes a battery connected to the vbat pin. this table lists only the sfr registers that are not generic 8051 sfr reg isters. bits marked with ? apply to the 71m6531d/f only, bits marked with ? apply to the 71m6532d/f only and should be 0 for the other device. table 54 : i/o ram map in functional order name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 configuration: ce0 2000 equ[2:0] ce_e ce10mhz u ce1 2001 pre_samps[1:0] sum_cycles[5:0] ce2 2002 u chop_e[1:0] rtm_e wd_ovf ex_rtc ex_xfr comp0 2003 u pll_ok u u u u u comp_stat config0 2004 vref_cal pls_inv u ckout_e vref_dis mpu_div[2:0] config1 2005 u u eck_dis m26mhz adc_e mux_alt u m40mhz version 2006 version[7:0] config2 2007 opt_txe[1:0] ex_pll ex_fwcol fir_len[1:0] opt_fdc[1:0] ce3 209d u mux_div[3:0] ce4 20a7 boot_size[7:0] ce5 20a8 ce_lctn[7:0] wake 20a9 wake_arm sleep lcd_only u wake_res wake_prd[2:0] tmux 20aa u tmux[4:0] anactrl 20ab r (0000) lcd_dac[2:0] chop_i_en ? config3 20ac u sel_ib n? chop_ib ? u sel_ian ? chop_ia ? config4 20ad u r (0) r (0) u r (0) r (0) interrupts and wd timer : intbits sfr f8 wd_rst int6 int5 int4 int3 int2 int1 int0 iflags sfr e8 ie_pllfall ie_pllrise ie_wake ie_pb ie_fwcol1 ie_fwcol0 ie_rtc ie_xfer flash memory: erase sfr 94 flsh_erase[7:0] flshctl sfr b2 preboot secure wrprot_bt wrprot_ce u flsh_meen flsh_pwe fl_bank sfr b6 u flbank[2:0] pgadr sfr b7 flsh_pgadr[5:0] u downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 73 name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 digital i/o: 20af u dio_rrx[2:0] dio0 2008 dio_eex[1:0] opt_rxdis opt_rxinv dio_pw dio_pv opt_txmod opt_txinv dio1 2009 u dio_r1[2:0] ? u di_rpb[2:0] dio2 200a u u u dio_r2[2:0] dio3 200b u dio_r5[2:0] u dio_r4[2:0] dio4 200c u dio_r7[2:0] u dio_r6[2:0] dio5 200d u dio_r9[2:0] u dio_r8[2:0] dio6 200e u dio_r11[2:0] u dio_r10[2:0] 200f r (0) r (0) u dio_px dio_py u dio7 sfr 80 dio_0[7: 1] dio_0[0]? dio8 sfr a2 dio_dir0[7:1] dio_dir0[0]? dio9 sfr 90 dio_1[7:0] (port 1) dio10 sfr 91 dio_dir1[7:0] dio11 sfr a0 dio_2[7 ]? dio_2[ 6]? dio_2[5] ? dio_2[4] ? dio_2[3] ? dio_2[2 ] ? dio_2[1] dio_2[0 ]? dio12 sfr a1 dio_dir2[7 ] ? dio_dir2[6] ? dio_dir2[5] ? dio_dir2[4] ? dio_dir2[3] ? dio_dir2[2 ] ? dio_dir2[ 1] dio_dir2[0 ] ? dio13 sfr b0 r (0) dio_3[6 ]? dio_3[5 ] dio_3[ 4] ? dio_3[3 ] ? dio_3[2 ] ? dio_3[1 ] ? dio_3[0 ] ? real time clock: rtcctrl 2010 u rst_subsec rtca_adj 2011 u rtca_adj[6:0] subsec1 2014 subsec[7:0] rtc0 2015 u rtc_sec[5:0] rtc1 2016 u rtc_min[5:0] rtc2 2017 u rtc_hr[4:0] rtc3 2018 u rtc_day[2:0] rtc4 2019 u rtc_date[2:0] rtc5 201a u rtc_mo[3:0] rtc6 201b rtc_yr[7:0] rtcadj_h 201c u preg[16:14] rtcadj_m 201d preg[13:6] rtcadj_l 201e preg[5:0] qreg[1:0] we 201f rtc write protect register downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 74 rev 2 name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 lcd display interface: lcdx 2020 mux_sync_e bme r (0) r (0) u lcdy 2021 u lcd_y lcd_e lcd_mode[2:0] lcd_clk[1:0] lcd_map0 2023 lcd_bitmap[31:24] lcd_map1 2024 lcd_bitmap [39] ? lcd_bitmap [38 ]? lcd_bitmap [37 ] lcd_bitmap [36 ]? lcd_bitmap [35 ] lcd_bitmap [34 ] lcd_bitmap [33 ] lcd_bitmap [32 ] lcd_map2 2025 lcd_bitmap[47:40] ? lcd_map3 2026 u lcd_bitmap [50] ? lcd_bitmap [49 ] lcd_bitmap [48 ]? lcd_map4 2027 lcd_bitmap [63] lcd_bitmap [62]? lcd_bitmap [61]? lcd_bitmap [60]? u lcd_map5 2028 lcd_bitmap [71 ]? lcd_bitmap [70 ]? lcd_bitmap [69 ]? lcd_bitmap [68 ]? lcd_bitmap [67 ]? lcd_bitmap [66 ]? lcd_bitmap [65 ] lcd_bitmap [64 ] lcd_map6 2029 u lcd0 2030 lcd_seg42 [3:0] ? lcd_seg0[3:0] lcd1 2031 lcd_seg43 [3:0] ? lcd_seg1 [3:0] lcd2 2032 u lcd_seg2 [3:0] lcd3 2033 lcd_seg45 [3:0] ? lcd_seg3 [3:0] lcd4 2034 lcd_seg46 [3:0] ? lcd_seg4 [3:0] lcd5 2035 lcd_seg47 [3:0] ? lcd_seg5 [3:0] lcd6 2036 lcd_seg48[3:0] ? lcd_seg6 [3:0] ? lcd7 2037 lcd_seg49[3:0] lcd_seg7 [3:0] lcd8 2038 lcd_seg50 [3:0] ? lcd_seg8[3:0] lcd9 2039 u lcd_seg9[3:0] lcd17 2041 u lcd_seg17 [3:0] lcd18 2042 lcd_seg60 [3:0] ? lcd_seg18 [3:0] lcd19 2043 lcd_seg61 [3:0] ? lcd_seg19[3:0] lcd20 2044 lcd_seg62 [3:0] ? lcd_seg20 [3:0] ? lcd21 2045 lcd_seg63[3:0] lcd_seg21 [3:0] ? lcd22 2046 lcd_seg64[3:0] lcd_seg22 [3:0] ? lcd23 2047 lcd_seg65[3:0] lcd_seg23 [3:0] ? lcd24 2048 lcd_seg66[3:0] ? lcd_seg24[3:0] lcd25 2049 lcd_seg6 7 [3:0] ? lcd_seg25[ 3:0] lcd26 204a lcd_seg68 [3:0] ? lcd_seg26[ 3:0] downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 75 name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 lcd27 204b lcd_seg69 [3:0] ? lcd_seg27[ 3:0] ? lcd28 204c lcd_seg70 [3:0] ? lcd_seg28[ 3:0] lcd29 204d lcd_seg71 [3:0] ? lcd_seg29[ 3:0] lcd30 204e u lcd_seg30[ 3:0] lcd33 2053 u lcd_seg3 5 [3:0] lcd36 2054 u lcd_seg3 6 [3:0] ? lcd37 2055 u lcd_seg37[3:0] lcd38 2056 u lcd_seg38 [3:0] ? lcd41 2059 u lcd_seg41 [3:0] ? lcd_blnk 205a lcd_blkmap19[3:0] lcd_blkmap18[3:0] rtm: rtm0h 2060 u rtm0[9:8] rtm0l 2061 rtm0[7:0] rtm1h 2062 u rtm1 [9:8] rtm1l 2063 rtm 1 [7:0] rtm2h 2064 u rtm2 [9:8] rtm2l 2065 rtm 2 [7:0] rtm3h 2066 u rtm 3 [9:8] rtm3l 2067 rtm3 [7:0] spi interface: spi 2070 spe u sp_cmd 2071 sp_cmd[7:0] sp_adh 2072 sp_addr[15:8] sp_adl 2073 sp_addr[7:0] pulse generator: pls_w 2080 pls_maxwidth[7:0] pls_i 2081 pls_interval[7:0] adc mux: slot0 2090 slot1_sel slot0_sel slot1 2091 slot3_sel slot2_sel slot2 2092 r r slot3 2093 r r slot4 2094 r r downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 76 rev 2 name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 slot5 2096 slot1_altsel slot0_altsel slot6 2097 slot3_altsel slot2_altsel slot7 2098 r r slot8 2099 r r slot9 209a r r spi interrupt: spi0 20b0 u ien_spi u ien_wd_nrovf spi1 20b1 u spi_flag u wd_nrovf_flag general - purpose nonvolatile registers: gp0 20c0 gpo[7:0] gp7 20c7 gp7[7:0] version 20c8 version[7:0] serial eeprom: eedata sfr 9e eedata[7:0] eectrl sfr 9f eectrl[7:0] ? 71m6531d/f only ? 71m6532d/f only downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 77 4.2 i/o ram d escription C alphabetical order the following conventions apply to the descriptions in this table: ? bits with a w (write) direction are written by the mpu into configurati on ram . typically, they are initially stored in flash memory and copied to the configuration ram by the mpu . some of the more frequently programmed bits are mapped to the mpu sfr memory space . the remaining bits are mapped to 2xxx . ? bits with a r (read) direction can be read by the mpu . ? columns labeled reset and wake describe the bit values upon reset and wake, respecti vely . n v in the wake column means the bit is powered by the nonvolatile supply and is not initialized . lcd - related registers labeled l retain data upon transition from lcd mode to b rown out mode and vice versa, but d o not retain data in sleep mode. C means that the value is undefined. ? write - only bits will return zero when they are read. table 55 : i/o ram description - alphabetical name location reset wake dir description adc_e 2005[3] 0 0 r/w enables adc and vref . when disabled, removes bias current . bme 2020[6] 0 C r/w battery measure enable . when set, a load current is immediately applied to the battery and it is connected to the adc to be measured on alternative mux cycles . see the mux_alt bit. boot_size[7:0] 20a7[7:0] 01 01 r/w end of space r eserved for boot program . the ending address of the boot region is 1024* boot_size . ce10mhz 2000[3] 0 0 r/w ce clock select . when set, the ce is clocked at 10 mhz . otherwise, the ce clock frequency is 5 mhz. ce_e 2000[4] 0 0 r/w ce enable. ce_lctn[7 :0] 20a8[4:0] 31 31 r/w ce program location . the starting address for the ce program is 1024* ce_lctn . chop_e[1:0] 2002[5:4] 0 0 r/w chop enable for the reference bandgap circuit . the value of chop will change on the rising edge of muxsync according to the value in chop_e[1:0] : 00 = toggle , except at the mux sync edge at the end of sumcycle, an alternative mux frame is automatically inserted at the end of each accumulation interval. 01 = positive . 10 = reversed . 11 = toggle , no alternative mux frame is inserted chop_ia 20ac[0] 0 0 r/w th is bit enable s chop mode for the ia current channel (71m6532d/f only) . chop_i_e must be set also. chop_i b 20ac[4 ] 0 0 r/w th is bit enable s chop mode for the ib current channel ( 71m6532d/f only) . chop_i_e must be set also. chop_i_e 20ab [0] 0 0 r/w th is bit must be set to enable chop mode for the current channel s ( 71m6532d/f only) . downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 78 rev 2 name location reset wake dir description ck out_e 2004[4 ] 0 0 r /w contro l bit for the seg19/ckout pin: 0: the pin is the seg19 lcd driver 1: the pin is the ck_fir output (5 mhz in mission mode, 32 khz in brownout mode) compstat 2003[0] C C r status bit for the v1 comparator (same as v1_ok, see tmuxout) . di_rpb[2:0] dio_r1[2:0] dio_r2[2:0] dio_r4 [2:0] dio_r5[2:0] dio_r6[2:0] dio_r7[2:0] dio_r8[2:0] dio_r9[2:0] dio_r10[2:0] dio_r11[2:0] dio_rrx[2:0] 2009[2:0] 2009[6:4] 200a[2:0] 200b[2:0] 200b[6:4] 200c[2:0] 200c[6:4] 200d[2:0] 200d[6:4] 200e[2:0] 200e[6:4] 20af[2:0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 r/w connects dedicated i/o pins dio2 and dio4 through dio11 as well as input pins pb, dio1 and rx to internal resources. if more than one input is connected to the same resource, the m ultiple column in the table below specifies how they are co mbined. dio_rx [2:0] resource m ultiple 000 none C 001 reserved or 010 t0 (counter / timer 0 clock or gate) or 011 t1 (counter / timer 1 clock or gate) or 100 high priority io interrupt (int0 rising) or 101 low priority io interrupt (int1 rising) or 110 high priority io interrupt (int0 fal l- ing) or 111 low priority io interrupt (int1 falling) or dio_dir0[7:1] sfr a2 [7:1] 0 C r/w programs the direction of dio pins 7 through 1. 1 indicates an output. the bits are ignored if the pin is not configured as dio. see dio_pv and dio_pw for special options for dio6 and dio7. see dio_eex[1:0] for special options for dio4 and dio5. dio_dir1[7:0] sfr 91 0 C r/w programs the direction of dio pins 15 through 8. 1 indicates an output. the bits are ignored if the pin is not configured as i/o. see dio_px and dio_pw for special options for the dio8 and dio9 outputs. dio_dir2[1] sfr a1 [1] 0 C r/w programs the direction of dio17. dio_0[7:0] dio_1[7:0] dio_2[1] dio_3[5:4] sfr 80 sfr 90 sfr a0[1] sfr b0[5:4] 0 0 0 0 ? C C C r/w r/w r/w r/w the value on the dio pins. pins configured as lcd will read zero. when written, changes data on pins configured as outputs. pins configured as lcd or input will ignore writes. dio_0[7:1] corresponds to dio7 through dio1 . pb is read on dio_0[0] . dio_1[7:0] corresponds to dio15 through dio8. dio_2[1] corresponds to dio17. dio_3[5:4] corresponds to dio28 and dio29 . downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 79 name location reset wake dir description dio_eex[1:0] 2008[7:6] 0 0 r/w when set, converts dio4 and dio5 to interface with external eeprom. di o4 becomes sdck and dio5 becomes bi - directional sdata. dio_eex[1:0] function 00 disable eeprom interface 01 2- wire eeprom interface 10 3- wire eeprom interface 11 not used dio_pv 2008[2] 0 0 r/w causes varpulse to be output on dio7. dio_pw 2008[3] 0 0 r/w causes wpulse to be output on dio6. dio_px 200f[3] 0 0 r/w causes xpulse to be output on dio8 . dio_py 200f[2] 0 0 r/w causes ypulse to be output on dio9 . eedata[7:0] sfr 9e 0 0 r/w serial eeprom interface data . eectrl[7:0] sfr 9f 0 0 r/w serial eeprom interface control . eck_dis 2005[5] 0 0 r/w emulator clock disable. when eck_dis = 1 , the emulator clock is disabled. if eck_dis is set, the emulator and programming devices will be unable to erase or program the device. equ[2:0] 2000[7:5] 0 0 r/w specifies the power equation to be used by the ce. ex_xfr ex_rtc ex_fwcol ex_pll 2002[0] 2002[1] 2007[4] 2007[5] 0 0 0 0 0 0 0 0 r/w interrupt enable bits. these bits enable the xfer_busy, the rtc_1sec, t he fir m- warecollision (fwcol) and pll interrupts. note that if one of these interrupts is to be enabled, its corresponding mpu ex enable must also be set. see section 1.4.9 interrupts for details. fir_len[1:0] 2007[3:2] 1 1 r/w fir_len [1:0] controls the length of the adc decimation fir filter and therefore controls the time taken for each conversion . [ m40mhz, m26mhz ] fir_len[1:0] resulting fir filter cycles resulting ck32 cycles resulting dc gain [00], [10], or [11] 00 138 1 0.110017 01 288 2 1.000 10 384 3 2.37037 [01] 00 186 1 0.113644 01 384 2 1.000 10 588 3 3.590363 fl_bank[2:0] sfr b6[ 2 :0] 1 1 r/w flash bank. m emory above 32 kb is mapped to the mpu address space from 0x8000 to 0xffff in 32 kb banks. when mpu address[15] = 1, the address in flash is mapped to fl_bank[2:0], mpu address[14:0]. fl_bank is reset by the erase cycle. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 80 rev 2 name location reset wake dir description flsh_erase [7:0] sfr 94[7:0] 0 0 w flash erase initiate . (default = 0x00) . flsh_erase is used to initiate either the flash mass erase cycle or the flash page erase cycle. specific patterns are exp ected for flsh_erase in order to initiate the appropriate erase cycle. 0x55 = i nitiate flash page erase cycle. must be proceeded by a write to flsh_pgadr [5:0] @ sfr 0xb7. 0xaa = initiate flash mass erase cycle. must be proceeded by a write to flsh_meen @ sfr 0xb2 and the debug (cc) port must be enabled. any other pattern written t o flsh_erase will have no effect. the erase cycle is not completed until 0x00 is written to flsh_erase . flsh_meen sfr b2[1] 0 0 w mass erase enable . 0 = mass erase disabled (default). 1 = mass erase enabled. must be re - written for each new mass erase cycle. flsh_pgadr [5:0] sfr b7 [7:2] 0 0 w flash page erase address . (d efault = 0x00) flsh_pgadr [5:0] with fl_bank [2:0], sets the flash page address (page 0 through 127) that will be erased during the page erase cycle . must be re - written for each new page erase cycle . flsh_pwe sfr b2[0] 0 0 r/w program write enable . this bit must be cleared by the mpu after each byte write o p- eration. write operations to this bit are inhibited when interrupts are enabled. 0 = movx commands refer to xram space, normal operation (default). 1 = movx @dptr,a moves a to program space (flash) @ dptr. gp0 gp7 20c0 20c7 0 0 nv nv r/w non - volatile general - purpose registers powered by the rtc supply. these registers maintain their value in all power modes, but will be cleared on reset. the values of gp0gp7 will be undefined if vbat drops below the minimum value. ie_fwcol0 ie_fwcol1 sfr e8[2] sfr e8[3] 0 0 0 0 r/w r/w interrupt flags for firmware collision interrupt. see the flash memory section for de tails. ie_pb sfr e8[4] 0 C r/w pb flag. indicates that a rising edge occurred on pb. firmware must write a zero to this bit to clear it. the bit is also cleared when the mpu re quests sleep or lcd mode. on bootup, the mpu can read this bit to determine if the part was woken wi th the pb ( dio0[0] ). ie_pllrise sfr e8[6] 0 0 r/w indicates that the mpu was woken or interrupted (int4) by system power bec oming available, or more precisely, by pll_ok rising. the firmware must w rite a zero to this bit to clear it . ie_pllfall sfr e8[7] 0 0 r/w indicates that the mpu has entered brownout mode because s ystem power has become unavailable (int4), or more precisely, because pll_ok fell. t his bit will not be set if the part wakes into brownout mode because of pb or the wake t imer. the firmware must write a zero to this bit to clear it. ien_spi 20b0[4] 0 C r/w spi interrupt enable. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 81 name location reset wake dir description ien_wd_nrovf 20b0[0] 0 0 r/w active high watchdog near overflow interrupt enable. ie_xfer ie_rtc sfr e8[0] sfr e8[1] 0 0 0 0 r/w interrupt flags. these flags monitor the xfer_busy interrupt and the rtc_1se c interrupt. the flags are set by hardware and clear auto matically . ie_wake sfr e8[5] 0 C r/w indicates that the mpu was awakened by the autowake timer. this bit is typically read by the mpu on bootup. the firmware must write a zero to this bit to cl ear it . intbits sfr f8[6:0] C C r/w interrupt inputs. the mpu may read these bits to see the status of external interrupts int0, int1 up to int6. these bits do not have any memory and are primarily intended for debug use. lcd_bitmap [31:24] 2023 0 l r/w configuration for dio11/seg31 through dio4/seg24. unused bits sho uld be set to zero. 1 = lcd pin, 0 = dio pin. check table 54 for bit availability. lcd_bitmap [39 :32] 2024 0 l r/w bitmap of d io19/seg39 through dio12/seg32. unused bits should be set to zero. 1 = lcd pin, 0 = dio pin. check table 54 for bit availability. lcd_bitmap [55 :48] 2026 0 l r/w bitmap of dio28/seg48 through dio35/seg55 . unused bits should be set to zero. 1 = lcd pin, 0 = dio pin. check table 54 for bit availability. lcd_bitmap [63 :56 ] 2027 0 l r/w bitmap of dio36/seg56 through dio43/seg63 . unused bits should be set to zero. 1 = lcd pin, 0 = dio pin. check table 54 for bit availability. lcd_bitmap [71 :64] 2028 0 l r/w bitmap of dio44/seg64 through dio51/seg71 . unused bits should be set to zero. 1 = lcd pin, 0 = dio pin. check table 54 for bit availability. lcd_blkmap19 [3:0] lcd_blkmap18 [3:0] 205a[7:4] 205a[3:0] 0 l r/w identifies which segments connected to seg18 and seg19 should blink. 1 means blink. the m ost significant bit corresponds to com3, the least significant bit to com0. lcd_clk[1:0] 2021[1:0] 0 l r/w sets the lcd clock frequency for com/seg pins ( not frame rate) according to the fol lowing (f w = 32768 hz ): 00 = f w /2 9 01 = f w/ 2 8 10 = f w /2 7 11 = f w /2 6 downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 82 rev 2 name location reset wake dir description lcd_dac[2:0] 20ab[3:1] 0 l r/w lcd contrast control dac. adjusts the lcd voltage in steps of 0.2 v f rom v3p3sys (mission mode) or vbat ( brownout /lcd modes). lcd_dac[2:0] resulting lcd voltage 000 v3p3 or vbat 001 v3p3 or vbat C 0.2v 010 v3p3 or vbat C 0.4v 011 v3p3 or vbat C 0.6v 100 v3p3 or vbat C 0.8v 101 v3p3 or vbat C 1.0v 110 v3p3 or vbat C 1.2v 111 v3p3 or vbat C 1.4v lcd_e 2021[5] 0 l r/w enables the lcd disp lay. when disabled, vlc2, vlc1 and vlc0 are ground as are the com and seg outputs. lcd_mode[2:0] 2021[4:2] 0 l r/w the lcd bias mode. use the lcd dac in anactrl to reduce saturation. the number of states is the number of commons which are driven to multiplex the lcd. lcd_mode[2:0] function notes 00 0 4 states, ? bias ? bias modes can drive 3.3 v lcds. 001 3 states, ? bias 0 10 2 states, ? bias ? bias and static modes can drive both 3.3 v and 5 v lcds. 0 11 3 states, ? bias 100 static display lcd_only 20a9[5] 0 0 w puts the part to sleep, but with the lcd display still active. lcd_only is i gnored if system power is present. while in sleep mode , t he device will wake up on reset, when the auto wake timer times out, when the push button is pushed, or when system power returns. lcd_seg0[3:0] lcd_seg19[3:0] 2030[3:0] 2043[3:0] 0 0 l l r/w r/w lcd segment data. each word contains information for 1 to 4 time divisions of eac h segment. some addresses are used to address two segments. in each word, bit 0 corresponds to com0, bit 1 to com1, bit 2 to com2 and bit 3 to com3 of the first segment. b it s 4 through 7 correspond to com0 to com3, respe c- tively, of the second segment. care should be taken when writing to lcd_seg locations since some of them control dio pins. lcd_seg24[3:0] lcd_seg3 1 [3:0] 2048[3:0] 204f[3:0] 0 0 l l r/w r/w lcd_seg32 [3:0] 2050[3:0] 0 l r/ w downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 83 name location reset wake dir description lcd_seg33 [3:0] lcd_seg35 [3:0] 2051[3:0] 2053[3:0 ] 0 0 l l r/w r/w lcd_seg37 [3:0] 2055[3:0] 0 l r/w lcd_seg39 [3:0] lcd_seg41 [3:0] 2057[3:0] 2059[3:0 ] 0 0 l l r/w r/w lcd_seg48[7:4] lcd_seg49[7:4] 2036[7:4] 2037[7:4] 0 0 l l r/w r/w lcd_seg63[7:4] lcd_seg66 [7:4] 2045[7:4] 2048[7:4] 0 0 l l r/w r/w lcd_seg71[7:4] lcd_seg73 [7:4] 204d[7:4] 204f[7:4] 0 0 l l r/w r/w lcd_y 2021[6] 0 l r/w lcd blink frequency (ignored if blink is disabled or if the segment is off). 0 = 1 hz (500 ms on, 500 ms off) 1 = 0.5 hz (1 s on, 1 s off) m26mhz m40mhz 2005[4] 2005[0] 0 0 0 0 r/w r/w m26mhz and m40mhz set the master clock (mck) frequency. these bits are reset on chip reset and may only be set. attempts to write zeroes to m40mhz and m26mhz . are ignored. mpu_div[2:0] 2004[2:0] 0 0 r/w the mpu clock divider (from mck) . these bits may be programmed by mpu without risk of losing control. mpu_div[2:0] resulting clock f requency 000 mck/2 2 001 mck/2 3 010 mck/2 4 011 mck/2 5 100 mck/2 6 101 mck/2 7 110 mck/2 8 111 mck/2 8 downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 84 rev 2 name location reset wake dir description mux_alt 2005[2] 0 0 r/w the mpu asserts this bit when it wishes the mux to perform adc conv ersions on an alternate set of inputs. if chop_e[1:0] is 00, mux_alt is automatically asserted once per sumcycle, when xfer_busy falls. mux_div[3:0] 209d[3:0 ] 0 0 r/w the number of states in the input multiplexer. mux_sync_e 2020[7] 0 0 r/w when set, seg7 outputs mux_sync. otherwise, seg7 is an lcd pin. opt_fdc[1:0] 2007[1:0] 0 0 r/w selects the modulation duty cycle for opt_tx . opt_fdc[1:0] function 00 50% low 01 25% low 10 12.5% low 11 6.25% low opt_rxdis 2008[5] 0 0 r/w configures opt_rx to an analog input to the optical uart comparator or as a digital in put/output, dio1: 0 = opt_rx, 1 = dio1. opt_rxinv 2008[4] 0 0 r/w inverts the result from the opt_rx comparator when 1. affects only the uart input. has no effect when opt_rx is used as a dio input. opt_txe[1:0] 2007[7: 6] 00 00 r/w configures the opt_tx output pin. opt_txe[1:0] function 00 opt_tx 01 dio2 10 wpulse 11 rpulse opt_txinv 2008[0] 0 0 r/w invert s opt_tx when 1. this inversion occurs before modulation. opt_txmod 2008[1] 0 0 r/w enables modulation of opt_tx. when opt_txmod is set, opt_tx is modulated when it would otherwise have been zero. the modulation is applied after any inversion caused by opt_txinv . pll_ok 2003[6] 0 0 r indicates that system power is present and the clock generation pll is set tled. pls_maxwidth [7:0] 2080[7:0] ff ff r/w determines the maximum width of the pulse (low going pulse). the m aximum pulse width is (2*pls_maxwidth + 1)*t i . where t i is pls_interval . if pls_interval = 0, t i is the sample time (397 s). if set to 255, pulse width control is disable d and pulses are output with a 50% duty cycle. pls_interval [7:0] 2081[7:0] 0 0 r/w for pulse_w and pulse_v only: i f the fifo is used, pls_interval must be set to 81 . if pls_interval = 0, the fifo is not used and pulses are output as soon as the ce issues them. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 85 name location reset wake dir description pls_inv 2004[6] 0 0 r/w inverts the polarity of the pulse outputs. normally, these pulses are ac tive low. when inverted, they become active high. preboot sfrb2[7] C C r indicates that the preboot sequence is active. preg[16:0] 201c[2:0] 201d[7:0] 201e[7:2] 4 0 0 nv nv nv r/w r/w r/w rtc adjust. see section 1.5.3 real - time clock (rtc) for additional details . 0x0ffbf preg [16:0] 0x10040 preg[16:0] and qreg[1:0] are separate in hardware but can be programmed with a single number calculated by the mpu. preg [16:0] and qreg [ 1:0] are non - volatile, but have no correcting function in sleep mode. pre_samps[1:0] 2001[7:6] 0 0 r/w the duration of the pre - summer, in samples. pre_samps[1:0] pre - summer duration 00 42 01 50 10 84 11 100 qreg[1:0] 201e[1:0] 0 0 r/w rtc adjust. see section 1.5.3 real - time clock (rtc) for additional details. rst_subsec 2010[0] 0 0 r/w the sub - second counter is restarted when a 1 is written to this bit. rtca_adj[6:0] 2011[6:0] 40 C r/w analog rtc adjust. see section 1.5.3 real - time clock (rtc) for additional details. rtc_sec[5:0 rtc_min[5:0] rtc_hr[4:0] rtc_day[2:0] rtc_date[4:0] rtc_mo[3:0] rtc_yr[7:0] 2015 2016 2017 2018 2019 201a 201b * * * * * * * nv nv nv nv nv nv nv r/w these are the year, month, day, hour, minute and second parameters of the rtc. w riting to these registers sets the time. each write operation to one of these registers must be preceded by a write to 0x201f ( we ). valid values for each parameter are: sec: 00 to 59, m in : 00 to 59, hr: 00 to 23 (00 = midnight) day : 01 to 07 (01 = sunday), date: 01 to 31, mo: 01 to 12 yr : 00 to 99 ( 00 and all others divisible by 4 are leap years) values in the rtc registers are undefined when the ic powers up without a batt ery but are maintained through mission and battery modes when a sufficient v oltage is maintained at the vbat pin. * no change of value at reset. see application note an4947 for details on rtc. rtm_e 2002[3] 0 0 r/w real time monitor (rtm) en able. when 0, the rtm output is low. rtm0[ 9 :0] rtm1[ 9 :0] rtm2[ 9 :0] rtm3[ 9 :0] 2060[9:8] 2061[7:0] 2062[9:8] 2063[7:0] 2064[9:8] 2064[7:0] 2065[9:8] 2066[7:0] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 r/w the four rtm probes. before each ce code pass, the values of these registers ar e serially output on the rtm pin. the rtm registers are ignored when rtm_e = 0. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 86 rev 2 name location reset wake dir description secure sfrb2[6] 0 C r/w when set, enables security provisions that prevent external reading of the flash mem ory (zeros will be returned if the flash is read) . secure should be set during the pre boot phase, i.e. while preboot is set. secure is cleared when the flash is mass - erased and when the chip is reset. the bit may only be set, attempts to write zero are ignored . sel_ian 20ac[1] 0 0 r/w when set to 1, selects differential mode for the current input (iap, ia n). when 0, the input remains single - ended (71m6532d/f only) . sel_ib n 20ac[5 ] 0 0 r/w when set to 1, selects differential mode for the current input (ibp, ib n). when 0, the input remains single - ended ( 71m6532d/f only) . sleep 20a9[6] 0 0 w puts the 71m6531 in to sleep mode. this bit is i gnored if system power is present. the 71m6531 will wake when the autowake timer times out, when the push button is pushed, when system power returns, or when reset goes high . slot0_sel[3:0] slot1_sel[3:0] slot2_sel[3:0] slot3_sel[3:0] 2090[3:0] 2090[7:4 ] 2091[3:0] 2091[7:4] 0 1 2 3 0 1 2 3 r/w primary multiplexer frame analog input selection. these bits map the selected input, 0-3 to the multiplexer state. t he adc output is always written to the memory location corresponding to the input , regardless of which multiplexer state an input is mapped to (see section 1.2 analog front end (afe) ). slot0_altsel [3:0] slot1_altsel [3:0] slot2_altsel [3:0] slot3_altsel [3:0] 2096[3:0] 2096[7:4] 2097[3:0] 2097[7:4] a 1 2 3 a 1 b 3 r/w alternate multiplexer frame analog input selection. maps the selected input to th e mul tiplexer state. the additional inputs, 10 and 11 in the alternate frame are: 10 = temp 11 = vbat sp_addr[15:8] sp_addr[7:0] 2072[7:0] 2073[7:0] 0 0 0 0 r r spi address. 16 - bit address from the bus master. sp_cmd 2071 0 0 r spi command. 8 - bit command from the bus master. spe 2070[7] 0 0 r/w spi port enable. enables the spi interface on pins seg3 through seg5. spi_flag 20b1[4] 1 1 r/w spi interrupt flag. the flag is set by the hardware and is cleared by the firmware writing a 0. firmware using this interrupt should clear the spurious interrupt indication during initialization. subsec[7:0] 2014[7:0] C C r the remaining count, in terms of 1/256 rtc cycles, to the next one second boundary. subsec may be read by the mpu after the one second interrupt and before reaching the next one second boundary. setting rst_subsec will clear subsec . sum_cycles [5:0] 2001[5:0] 0 0 r/w the number of pre - summer outp uts summed in the final summing stage of the ce. tmux[4:0] 20aa[4:0] 2 C r/w selects one of 32 signals for tmuxout. for details, see section 1.5.17 test ports (tmuxout pin) . trim[7:0] 20ff 0 0 r/w contains fuse information, depending on the value written to trimsel[3:0] . downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 87 name location reset wake dir description trimsel[3:0] 20fd[3:0] 0 0 r/w selects the trim fuse to be read with the trim register: trimsel[3:0] trim fuse purpo se 1 trimt [7 :0] trim for the magnitude of vref version[7:0] 2006 20c8 C C C C r r the device version index. this word may be read by the firmware to determine the silicon version. version[7:0] silicon version 0001 0 101 a0 5 vref_cal 2004[7] 0 0 r/w brings vref to the vref pad. this feature is disabled when vref_dis =1 . vref_dis 2004[3] 0 0 r/w disables the internal voltage reference. wake_arm 20a9[7] 0 C w arm the autowake timer. writing a 1 to this bit arms the autowake timer and p resets it with the values presently in wake_prd and wake_res . the autowake timer is reset and disarmed whenever the ic is in mission or brownout mode. the timer mu st be armed at least three rtc cycles before the sleep or lcd - only mode is commanded. wake_prd 20a9[2:0] 001 C r/w sleep time. time = wake_prd[2:0] * wake_res . default = 001. maximum value is 7. wake_res 20a9[3] 0 C r/w resolution of wake timer: 1 = 1 minute, 0 = 2.5 seconds. wd_nrovf_ flag 20b1[0] C 0 r/w this flag is s et approximately 1 ms before the watchdog timer overflows. it is c leared by writing a 0 or on the falling edge of wake. wd_rst sfr f8[7] 0 0 w wd timer bit. this bit must be accessed with byte operations. operations p ossible for this bit are: write 0xff: resets the wdt . wd_ovf 2002[2] 0 0 r/w the wd overflow status bit. this bit is set when the wd timer over flows. it is powered by the nonvolatile supply and at bootup will indicate if the part is rec overing from a wd overflow or a power fault. this bit should be cleared by the mpu on b ootup. it is also automatically cleared when reset is high. *not preserved in sleep mode we 201f[7:0 ] C C w an 8 - bit value has to be written to this address prior to accessing the rtc registers. wrprot_bt sfr b2[5] 0 0 when set, this bit protects flash addresses from 0 to boot_size *1024 from flash page erase. wrprot_ce sfr b2[4] 0 0 when set, this bit protects flash address es from ce_lctn *1024 to the end of memory from flash page erase. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 88 rev 2 4.3 ce interface description 4.3.1 ce program the ce performs the precision computations necessary to accurately measure energy . different code variations are used for equ[2:0] = 0 and equ[2:0] = 1 or 2. the computations include offset cancellation, products, product smoothing, product summation, frequency detection, var calcul ation, sag detection, peak detection and voltage phase measurement. all data computed by the ce is dependent on th e selected met er equation as given by equ[2:0] . although equ[2:0] = 0 and equ[2:0] = 2 have the same element mapping, the mpu code can use the value of equ[2:0] to decide if element 2 is used for tamper detection (typically done by connecting vb to va) or as a second i ndependent element. the ce program is supplied by maxim as a data image that can be merged with the mpu operational code for meter applications . typically, the ce program covers most applications and does not need to be modified . other variations of ce code may be available from maxim . the description in this section a p- plies to ce code revision ce31a04 (for equ[2:0] = 0) . deviations for c ode revision ce31a03 ( for equ[2:0] = 1 or 2 ) are noted where applicable . 4.3.2 ce data format all ce words are 4 bytes . unless specified otherwise, they are in 32 - bit twos complement format (- 1 = 0xffffffff) . calibration para meters are defined in flash memory (or external eeprom) and must be copied to ce data memory by the mpu before enabling the ce . internal variables are used in internal ce calculations . input variables allow the mpu to control the behavior of the ce code . output variables are outputs of the ce calculations . the corresponding mpu address for the most signi ficant byte is given by 0x0000 + 4 x ce_address and by 0x0003 + 4 x ce_address for the least significant byte. 4.3.3 constants constants used in the ce data memory tables are: ? f s = 32768 hz/13 = 2520.62 hz. ? f 0 is the fundamental frequency. ? imax is the external rms current corresponding to 250 mv pk at the inputs ia and ib . ? vmax is the external rms voltage corresponding to 250 mv pk at the va and vb inputs. ? n acc , the accumulation count for energy measurements is pre_samps[1:0] * sum_cycles[5:0] . ? the duration of the accumulation interval for energy measurements is pre_samps[1:0] * sum_cycles [5:0] /f s ? ln_8 is a gain constant of the current channel , n. its value is 8 or 1 and is controlled by in_shunt . ? x is a gain constant of the pulse generators. its value is determi ned by pulse_fast and pulse_sl ow . ? voltage lsb for sag detection = vmax * 7.8798*10 -6 v. the system constants imax and vmax are used by the mpu to convert internal quantities (as used by the ce) to ex ternal, i.e. metering quantities . their values are determined by the off - chip scalin g of the voltage and current sensors used in an actual meter . the lsb values used in this document relate digital quantities at the ce or mpu interface to external meter input quantities . for example, if a sag threshold of 80 v peak is desired at the meter input, the digital value that should be pro grammed into sag_thr would be 80/ sag_thr lsb , where sag_thr lsb is the lsb value in the description of sag_thr . the parameters equ[2:0] , ce_e, pre_samps[1:0] and sum_cycles[5:0] essential to the function of t he ce are stored in i/o ram (see section 4.2 i/o ram description C alphabetical order ). 4.3.4 environment before starting the ce using the ce_e bit, the mpu has to establish the proper environment for the ce by implementing the following steps (for ce31a04 code) : ? load the ce data i nto ram. ? establish the equation to be applied in equ[2:0] . the ce code has to match the selected equation. ? establish the accumulation period and number of samples in pre_samps[1:0] = 0 (multiplier = 42) and sum_cycles[5:0] = 0x3c (60). ? set pls_interval [7:0 ] to 81. ? select the values for fir_len[1:0] = 2 and mux_div[3:0] = 4. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 89 ? select the values for slot0 _sel [3:0] = 0, slot1 _sel [3:0] = 1, slot2 _sel [3:0] = 2, slot3 _sel [3:0] = 3 ? select the values for slot 0 _altsel [3:0 ] = 0x0a, slot 1 _altsel [3:0] = 1, slot 2 _altsel [3:0] = 0x0b, slot 3 _altsel [3:0] = 3. ? set chop_e[1:0] = 00 . ? initialize any mpu interrupts, such as ce_busy, xfer_busy, or a power failure detection interrupt. when different ce codes are used, a different set of environment parameters needs to be established. the exact values for these parameters are stated in the application notes and other docu mentation ac companying the ce codes. ce codes should only be used with environment parameters specified in this document or in the applicable ce code description. changing environment parameters at random will lead to unpr e- dictable results. t ypically, th e re are thirteen 32768 hz cycles per adc multiplexer frame (see figure 19 ) . this means that the product of the number of cycles per frame and the number of conversions per frame must be 12 (allowing for one settling cycle). during operation, chop_e[1:0] = 00 enables the automatic chopping mode and forces an alternate multiplexer sequence at regular intervals . this enables accurate temperature measurement. 4.3.5 ce calculations table 56 : ce equ[2:0] equations and element input mapping equ[2:0] watt & var formula (wsum/varsum) element input mapping w0sum/ var0sum w1sum/ var1sum i0sqsum i1sqsum 0 va ia (1 element, 2w 1 ) with tamper detec tion va*ia va*ib ia ib 1 va*(ia - ib)/2 (1 element, 3w 1 ) va*(ia - ib)/2 (va * ib)/2 ia - ib ib 2 va*ia + vb*ib (2 element, 4w 2 ) va*ia vb*ib ia ib 4.3.6 ce s tatus and control the cestatus register provides information about the status of voltage and input ac signal frequenc y, which are useful for generating early power fail warnings, e.g. to init iate necessary data storage. it contains sag warning flag s for va and vb as well as f 0 , the derived clock operating at the fundamental input frequen cy. cestatus represents the status flags for the preceding ce code pass (ce busy interr upt). sag alarms are not remembered from one code pass to the next. the ce status word i s refreshed at every ce_busy interrupt. the significance of the bits in cestatus is shown in table 57 . ce address name description 0x80 cestatus see description of cestatus bits in table 57 . since the ce_busy interrupt typically occurs at 2520.6 hz, it is d esirable to minimize the computation required in the interrupt handler of the mpu. rather than reading the ce stat us word at every ce_busy interrupt and interpret the sag bits, it is recommended that the mpu activate the ypulse output to generate interrupts when a sag occurs (see the description of the ceconfig register) downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 90 rev 2 table 57 : cestatus (ce ram 0x80) bit definitions cestatus [bit] name description 31: 29 not used these unused bits will always be zero. 28 f0 f0 is a square wave at the exact fundamental frequency for the phase selected with the freqseln bits in ceconfig . 27 reserved 26 sag_b normally zero . becomes one when vb remains below sag_thr for sag_cnt samples . will not return to zero until vb rises above sag_thr . 25 sag_a normally zero . becomes one when va remains below sag_thr for sag_cnt samples . will not return to zero until va rises above sag_thr . 24: 0 not used these unused bits will always be zero. the ce is initialized and its functions are controlled by the mpu using ceconfig . this register contains in packed form sag_cnt, freqsel, ext_pulse, i0_shunt, i1_shunt, puls e_slow and pulse_fast . the ceconfig bit definitions are given in table 58 . ce address name data description 0x20 ceconfig 0x5020 see description of the ceconfig bits in table 58 . ia_shunt and/or ib_shunt can configure their respective current inputs to accept shunt resis tor sensors. in this case the ce provides an additional gain of 8 to the selected current input. wrate may need to be adjusted based on the values of ia _ shunt and ib_shunt . whenever ia_shunt or ib_shunt are set to 1, in_8 (in the equation for kh) is assigned a value of 8. the ce pulse generator can be controlled by either the mpu (external) or ce (internal) variables. control is by the mpu if ext_pulse = 1. in this case, the mpu controls the pulse rate by placing values i nto apulsew , apulser , apulse2 and apulse3 . by setting ext_pulse = 0, the ce controls the pulse rate based on w0sum _ x and var0sum _ x ( equ[2:0] = 0) or wsum_x ( equ[2:0] = 2). if ext_pulse = 0 and equ[2:0] = 2, the pulse inputs are w0sum_x + w1sum_x and var0sum_x + var1sum_x. in this case, creep cannot be controlled since creep is an mpu function . if ext_pulse = 0 and equ[2:0] = 0, the pulse inputs are w0sum_x if i0sqsum_x > i1sqsum_x and w1sum_x, if i1sqsum_x > i0sqsum_x . the 71m 6531 demo code creep function halts both internal and external pulse generation. the ext_temp bit controls the temperature compensation mode: ? when ext_temp = 0 (internal compensation), the ce will control the gain using gain_adj (see table 60 ) based on ppmc , ppmc2 and temp_x , the difference between die temperature and the reference / calibration temperature temp_nom . since ppmc and ppmc2 reflect the typical behavior of the reference voltage over temperature, the internal temperature compensation eliminates the effec ts of temperature - related errors of vref only. ? when ext_temp = 1 (external compensation), the mpu is allowed to control the ce gain us ing gain_adj , based on any algorithm implemented in mpu code. the freqsel1 and freqsel0 bits select the phase used to control the ce - internal pll. ce accuracy depends on the channel selected by the freqsel1 and freqsel0 bits receiving a clean voltage signal. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 91 table 58 : ceconfig bit definitions ceconf g [bit] name default description [19 ] [18 ] sag_mask1 sag_mask0 0 0 sets the sag control of phase b. sets the sag control of phase a. if more than one sag mask is set, a sag interrupt will only be generated when all phases enabled for the interrupt sag . [17 ] sag_int 0 when set, enables the sag interrupt to be output on the ypulse /dio9 pin. [16 ] ext_temp 0 when set, enables the control of gain_adj by the mpu. when 0, enables the control of gain_adj by the ce. [15:8] sag_cnt 80 (0x50) the number of consecutive voltage samples below sag_thr before a sag alarm is declared. the maximum value is 255. sag_thr is at address 0x2 4. [7] freqsel1 0 the combination of freqsel1 and freqsel0 s elects the phase to be used for the frequency monitor, the phase - to - phase lag calculation, the zero - crossing counter mainedge_x and the f0 bit ( cestatus[28] ). freqsel1 / freqsel 0 = 0/0: phase a freqsel1 / freqsel 0 = 0/1: phase b [6] freqsel0 0 [5] ext_pulse 1 when zero, causes the pulse generators to respond to internal data ( pulse0 = wsum_x , pulse1 = varsum_x ., pulse2 = vasum_x ) . otherwise, the generators respond to values the mpu places in apulsew and apulser . [4] C 0 unused . [3] ib_shunt 0 when 1, the current gain of channel b is increased by 8. the gain factor controlled by in_shunt is referred to as in_8 throughout this document. [2] ia_shunt 0 when 1, the current gain of channel a is increased by 8. [1] pulse_fast 0 when pulse_fast = 1, the pulse generator input is increased 16x . when pulse_slow = 1, the pulse generator input is reduced by a factor of 64. these two bits control the pulse gain factor x (see table below). default is 0 for both (x = 6). pulse_slow pulse_fast x 0 0 1.5 * 2 2 = 6 0 1 1.5 * 2 6 = 96 1 0 1.5 * 2 -4 = 0.09375 1 1 do not use [0] pulse_slow 0 table 59 : sag threshold control ce address name default description 0x24 sag_thr 443000 the threshold for sag warnings. the default value is equivalent to 80 v rms if vmax = 600 v. the lsb value is vmax * 4.255*10 - 7 v (peak). table 60 : gain adjust control ce address name default description 0x40 ga in _ adj 16384 this register scales all voltage and current channels. t he default value is equivalent unity gain (1.000) . downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 92 rev 2 4.3.7 ce transfer v ariables when the mpu receives the xfer_busy interrupt, it knows that fresh dat a is available in the transfer variables . ce trans fer variables are modified during the ce code pass that ends with an xfer_bu sy interrupt. they remain constant throughout each accumulation interval. in this data sheet, the names of ce transfer variables always end with _x . the transfer variables can be categorized as: 1. fundamental energy measurement variables 2. instantaneous (rms) values 3. other measurement parameters fundamental energy measurement variables table 61 describes each transfer variable for fundamental energy measurement. all variables are signed 32 - bit integers. accumulated variables such as wsum are internally scaled s o they have at least 2x margin before overflow when the integration ti me is one second. additionally, the hardware will not permit output values to fold back upon overflow. table 61 : ce transfer variables ce address name description 0x85 w sum_x for equ[2:0] = 2, this register holds the c alculated sum of w h samples from each wattmeter element ( in_8 is the gain of 1 or 8 configured by ia_shunt or ib_shunt ). lsb = 6.6952*10 - 13 vmax imax / in_8 wh. 0x86 w0sum_x the sum of w h samples from each wattmeter element ( in_8 is the gain of 1 or 8 configured by ia_shunt or ib_shunt ). lsb = 6.6952*10 - 13 vmax imax / in_8 wh. 0x87 w1sum_x 0x8a var sum_x for equ[2:0] = 2, this register holds t he calculated sum of varh samples from each element ( in_8 is the gain of 1 or 8 configured by ia_shunt or ib_shunt ). lsb = 6.6952*10 - 13 vmax imax / in_8 var h. 0x8b var0sum_x the sum of var h samples from each element ( in_8 is the gain 1 or 8 configured by ia_shunt or ib_shunt ). lsb = 6.6952*10 - 13 vmax imax / in_8 var h. 0x8c var1sum_x wxsum_x is the wh value accumulated for element x in the last accumulation interval and can be computed based on the specified lsb value. for example , with vmax = 600 v and imax = 208 a, the lsb for wxsum_x is 0.08356 wh. instantaneous measurement variables table 62 contains various measurement results. the frequency measurement is computed for the phase selected with freqseln bits in the ceconfig register . ixsqsum_x and vxsqsum are the squared current and voltage samples acquired during the last acc umula tion interval . they can be used to calculate rms voltages and currents. insqsum_x can be used for computing the neutral current. table 62 : ce energy measurement variables ce address name description 0x82 freq_x fundamental frequency . lsb 6 32 10 587 .0 2 ? ? s f hz 0x8f i0sqsum_x the sum of squared current samples from each element. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 93 0x90 i1sqsum_x lsb i = 6.6952*10 - 13 imax 2 / in_8 2 a 2 h 0x93 v0sqsum_x the sum of squared vol tage samples from each element. lsb v = 6.6952*10 - 13 vmax 2 v 2 h 0x94 v1sqsum_x 0x45 wsum_accum these registers contain roll - over accumulators for wpulse and vpulse respectively. 0x46 vsum_accum 0x47 sum 3 _accum these registers contain roll - over accumulators for pulse outputs xpulse and ypulse respectivel y. 0x48 sum 4 _accum 0x99 i0sqres_x these registers hold residual current measurements with double - precision accuracy. the exact current isqn is: isqn = insqsum_x + 2 32 * insqres_x 0x9a i1sqres_x the rms values can be computed by the mpu from the squared current and voltage samples as follows: acc s i rms n f lsb ixsqsum ix ? ? ? = 3600 other measurement parameters table 63 describes the ce measurement parameters listed below: ? mainedge_x: useful for implementing a real - time clock based on the input ac signal. mainedge_x is the number of half - cycles accounted for in the last accumulated interval for the ac signal. ? temp_raw: m ay be used by the mpu to monitor the chip temperature or to implement temperature compensation. ? gain_adj: a scaling factor for measurements based on the temperature. gain_adj can be controlled by the mpu for temperature compensation. ? vbat_sum_x : this result can be used to calculate the measured battery voltage (vbat). table 63 : useful ce measurement parameters ce address name default description 0x83 mainedge_x n/a the number of zero crossings of the voltage selected with freqseln in the previous accumulation interval . zero crossings are either direction and are de bounced. 0x81 temp_raw_x n/a the f iltered, un - scaled reading from the temperature sensor. 0x9d temp_x n/a this register contains the d ifference between the die temperature and the reference/calibration temperature as established in the temp_nom register , measured in 0.1c. 0x40 gain_adj 16384 scales all voltage and current inputs . a value of 16384 provides unity gain. this register is used by the ce or by the mpu to im ple ment temperature compensation. 0x84 vbat_sum_x n/a output of the battery measurement. this value is equivalent to twice the measured adc value. 4.3.8 pulse generation table 64 describes the ce pulse generation parameters wrate , apulsew , apulser , apulse2 and apulse3 . wrate controls the number of pulses that are generated per measured wh and varh quantities. the low er wrate is the slower the pulse rate for measured energy quantity. the met ering constant kh is derived from wrate as the amount of energy measured for each pulse. that is, if kh = 1 wh/pulse, a power applied to the meter of 120 v and 30 a (3,600 w) resu lts in one pulse per second. if the load is 240 v at 150 a (36,000 w) , ten pulses per second will be generated. the maximum pulse rate is 7.5 khz for apulsew and apulser and 1.2 khz for apulse2 and apulse3 . acc s v rms n f lsb vxsqsum vx ? ? ? = 3600 downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 94 rev 2 the maximum time jitter is 67 s and is independ ent of the number of pulses measured. thus, if the pulse generator is monitored for one second, the peak jitter is 67 ppm. af ter 10 seconds, the peak jitter is 6.7 ppm. the average jitter is always zero. if it is attempted to drive either pulse generator faster than its maximum rate, it will simply output at its maximum rate without exhibiti ng any rollover characteristics. the actual pulse rate, using wsum as an example, is: hz x f wsum wrate rate s 46 2 ? ? ? = , where f s = sampling frequency (2520.6 hz) and x = pulse speed factor (as defined in the ceconfig register with the pulse_fast and pulse_slow bits) . table 64 : ce pulse generation parameters ce address name default description 0x21 wrate 827 kh = vmax*imax*47.1132 / ( in_8 * wrate *n acc *x) wh/pulse . the defa ult value results in a kh of 1.0 wh/pulse when 2520 samples are taken in each accumulation interval (and vmax=600, imax = 442 [for 400 shunt] , in_8 = 1, x = 6). maximum value = 2 15 - 1. 0x41 apulsew 0 watt pulse generator input (see dio_pw bit) . the output pulse rate is: apulsew * f s * 2 - 32 * wrate * x * 2 - 14 . this input is buffered and can be loaded during a computation interval . the change will take effect at the beginning of the next interval. 0x42 apulser 0 var pulse generator input (see dio_pv bit) . the output pulse rate is: apulser * f s *2 - 32 * wrate * x * 2 - 14 . this input is buffered and can be loaded during a computation interval . the change will take effect at the beginning of the next interval. 0x43 apulse2 0 third pulse generator input (see dio_pv bit) . the output pulse rate is: apulse2 * f s *2 - 32 * wrate * x * 2 - 14 . this input is buffered and can be loaded during a computation interval . the change will take effect at the beginning of the next inte rval. 0x44 apulse3 0 fourth pulse generator input (see dio_pv bit). the output pulse rate is: apulse3 * f s *2 - 32 * wrate * x * 2 - 14 . this input is buffered and can be loaded during a computation interval. the change will take effect at the beginning of the next interval. 0x38 pulse width 12 register for pulse width control of xpulse and ypulse . the ma x- imum pulse width is (2* pulsewidth +1)*(1/fs). the default value will generate pulses of 10 ms width at fs = 2520.62 hz. 4.3.9 ce calibration parameters table 65 lists the parameters that are typically entered to effect calibration of meter accuracy. table 65 : ce calibration parameters ce address name default description 0x10 cal_ia 16384 these constants control the gain of their respective channels . the n ominal value for each parameter is 2 14 = 16384 . the gain of each channel is directly proportional to its gain constant . thus, if the gain of the ia channel is 1% slow, cal _ia should be scaled by 1/(1 C 0.01) and the resulting value is 16549. 0x11 cal_va 16384 0x12 cal_ib 16384 0x13 cal_vb 16384 0x18 phadj_a 0 these two constants control the ct phase compensation. no com pensation occurs when phadj_x = 0. as phadj_x is increased, more compensation (lag) is introduced. range: 2 15 C 1. if it is de sired to delay the current by the angle , the equations are: downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 95 ce address name default description 0x19 phadj_b 0 ? ? ? = tan tan x phadj 0131 .0 1487 .0 02229 .0 2 _ 20 at 60hz ? ? ? = tan tan x phadj 009695 .0 1241 .0 0155 .0 2 _ 20 at 50hz 0x1f temp_nom 0 this register contains the reference point for the temperature mea surement. at calibration temperature, the value read at temp_raw_x should be written to temp_nom . the ce will calculate the chip temperature temp_x relative to the reference temperature. 0x3 9 degscale 9174 the scale factor for the temperature calculation. it is not necessary to use values other than the default value. 4.3.10 other ce parameters table 66 shows the ce parameters used for suppression of noise due to scaling and truncation effects. the table also includes the parameter which indicates the ce code version. table 66 : ce parameters for noise su p pression and code version ce a d- dress name default description 0x22 kv ar 6448 this is the scale factor for the var calculation. no value other than the default value should be applied. 0x26 quant_a 0 these parameters are added to the watt calculation for e l- ement 0 and 1 to compensate for in put noise and truncation. lsb = (vmax*imax / in_8 ) *7.4162*10 - 10 w 0x27 quant_b 0 0x2a quant_vara 0 these parameters are added to the var calculation for e l- e ment a and b to com pensate for in put noise and truncation. lsb = (vmax*imax / in_8 ) * 7.4162*10 - 10 w 0x2b quant_varb 0 0x2e quant_ia 0 these parameters are added to compensate for input noise and truncation in their respective channels in the squaring calculations for i 2 and v 2 . lsb = vmax 2 *7.4162*10 - 10 v 2 and lsb = (imax 2 / in_8 2 )*7.4162*10 - 10 a 2 0x2f quant_ib 0 0x35 0x63653331 text strings holding the ce version information as supplied by the ce data associated with the ce code. for example, the words 0x63653331 and 0x61303463 form the text string ce31a04c. these locations are overwritten in operation. 0x36 0x61303463 0x37 0x00000000 4.3.11 ce flow diagrams figure 41 t hrough figure 43 show the data flow through the ce in simplified form. functions not shown include delay compensation, sample interpolation, scaling and processing of meter equations. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 96 rev 2 figure 41 : ce data flow: multiplexer and adc figure 42 : ce data flow: scaling, gain control, intermediate variables downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 97 figure 43 : ce data flow: squaring and summation stages downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 98 rev 2 5 e lectrical s pecifications 5.1 a bsolute m aximum r atings table 67 shows the absolute maximum ranges for the device. stresses beyond ab solute maximum ratings may cause permanent damage to the device. these are stress ratings only and funct ional operation at these or any other conditions beyond those indicated under recommended operating condit ions ( section 5.3 ) is not implied. exposure to absolute - maximum - rated conditions for extended periods may affect device reliability. all voltages are with respect to gnda. table 67 : absolu te maximum ratings voltage and current supplies and ground pins v3p3sys, v3p3a ? 0.5 v to 4.6 v vbat - 0.5 v to 4.6 v gndd - 0.5 v to +0.5 v analog output pins v3p3d - 10 ma to 10 ma, - 0.5 v to 4.6 v vref - 10 ma to +10 ma, - 0.5 v to v3p3a+0.5 v v2p5 - 10 ma to +10 ma, - 0.5 v to 3.0 v analog input pins ia, va, ib, vb, v1 - 10 ma to +10 ma - 0.5 v to v3p3a+0.5 v xin, xout - 10 ma to +10 ma - 0.5 v to 3.0 v all other pins configured as seg or com drivers -1 ma to +1 ma, - 0.5 to v3p3d+0.5 configured as digital inputs - 10 ma to +10 ma, - 0.5 to 6 v configured as digital outputs - 15 ma to +15 ma, - 0.5 v to v3p3d+0.5 v all other pins ? 0.5 v to v3p3d+0.5 v temperature and esd stress operating junction temperature (peak, 100ms) 140 c operating junction temperature (continuous) 125 c storage temperature ? 45 c to +165 c solder temperature C 10 second duration 250 c esd stress on all pins 4 kv downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 99 5.2 recommended external components table 68 : recommended external components name from to function value unit c1 v3p3a agnd bypass capacitor for 3.3 v supply 0.1 20% ? f c2 v3p3d gndd bypass capacitor for 3.3 v output 0.1 20% ? f csys v3p3sys gndd bypass capacitor for v3p3sys 1.0 30% f c2p5 v2p5 gndd bypass capacitor for v2p5 0.1 20% f xtal xin xout 32.768 khz crystal C electrically similar to ecs .327 - 12.5 - 17x or vishay xt26t, load capacitance 12.5 pf 32.768 khz cxs xin agnd load capacitor for crystal (depends on crystal specs and board parasitics). 33 10% pf cxl xout agnd load capacitor for crystal (depends on crystal specs and board parasitics). 7 10% ?? pf notes: 1. agnd and gndd should be connected together. 2. v3p3sys and v3p3a should be connected together. ? for accuracy and emi rejection, c1 + c2 should be 470 f or higher. ?? 10, 12, or 15 pf may be used if 7 pf is not available, with limited ran ge for rtca_adj . 5.3 r ecommended operating c onditions table 69 : recommended operating conditions p arameter condition min typ max unit v3p3sys, v3p3a : 3.3 v supply voltage v3p3a and v3p3sys must be at the same voltage normal operation 3.0 3.3 3.6 v battery backup 0 3.6 v vbat no battery externally connect to v3p3sys battery backup : brn and lcd modes sleep mode 3.0 2.0 3.8 3.8 v v operating temperature - 40 +85 oc downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 100 rev 2 5.4 p erformance s pecifications 5.4.1 input logic levels table 70 : i nput logic levels p arameter c ondition m in t yp m ax u nit digital high - level input voltage a , v ih 2 v digital low - level input voltage a , v il 0.8 v input pull - up current, i il e_rxtx, e_rst, cktest other digital inputs vin=0 v, ice_e=1 10 10 -1 0 100 100 1 a a a input pull down current, i ih ice_e reset pb other digital inputs vin = v3p3d 10 10 -1 -1 0 0 100 100 1 1 a a a a a in battery powered modes, digital inputs should be below 0.3 v or above 2.5 v to minimize battery current. 5.4.2 o utput logic levels table 71 : output logic levels p arameter c ondition m in t yp m ax u nit digital high - level output voltage v oh i load = 1 ma v3p3d C 0.4 v i load = 15 ma v3p3d - 0.6 v digital low - level output voltage v ol i load = 1 ma 0 0.4 v i load = 15 ma 0.8 v opt_tx v oh ( v3p3d - opt_tx ) i source =1 ma 0.4 v opt_tx v ol i sink =20 ma 0.7 v 5.4.3 power - fault c omparator table 72 : power -f ault comparator performance specifications p arameter c ondition m in t yp m ax u nit offset voltage : v1 - vbias - 20 +15 mv hysteresis current: v1 vin = vbias C 100 mv 0.8 1.2 a response time : v1 + 100 mv overdrive voltage at v1 rising voltage at v1 falling 10 8 37 100 100 s s wdt disable threshold: v1 - v3p3a - 400 - 10 mv 5.4.4 battery monitor table 73 : batter y monitor performance specifications ( bme = 1) p arameter c ondition m in typ max unit load resistor 27 45 63 k lsb value [ m40mhz , m26mhz ] = [00], [10], or [11] fir_len[1:0] =0 (l=138) fir_len[1:0] =1 (l=288) fir_len[1:0] =2 (l=384) (- 10%) - 48.7 - 5.35 - 2.26 (+10%) v v v [ m40mhz , m26mhz ] = [01] fir_len[1:0] =0 (l=186) fir_len[1:0] =1 (l=384) fir_len[1:0] =2 (l=588) (- 10%) - 19.8 - 2.26 - 0.63 (+10%) v v v offset error - 200 0 +100 mv downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 101 5.4.5 s upply c urrent table 74 : supply current performance specifications p arameter c ondition m in t yp max unit v3p3sys current (ce off) normal operation, v3p3a = v3p3sys = 3.3 v ckmpu = 614 khz no flash memory write rtm_e =0, eck_dis =1, adc_e =1, ice_e=0 4.2 6 .3 5 ma v3p3sys current (ce on) 8.4 9.6 ma v3p3a current 3. 3 3.8 ma vbat current - 400 +400 na v3p3sys current, write flash normal operation as above, except write flash at maximum rate, ce_e = 0, adc_ e = 0 9.1 12 ma vbat current vbat=3.6v brownout mode 71m6531d/f 71m6532d/f lcd mode lcd dac off lcd dac on sleep mode 52 82 11 21 0.7 25 0 250 40 46 1.5 a a a a a 5.4.6 v3p3d s witch table 75 : v3p3d switch performance specifications p arameter c ondition m in t yp max unit on resistance C v3p3sys to v3p3d | i v3p3d | 1 ma 9 15 on resistance C vbat to v3p3d | i v3p3d | 1 ma 32 50 5.4.7 2.5 v v oltage r egulator table 76 : 2.5 v voltage regulator performance specifications p arameter c ondition m in t yp max unit v2p5 i load = 0 2.3 2.5 2.7 v v2p5 load regulation i load = 0 ma to 5 ma 40 mv voltage overhead v3p3 - v2p5 i load = 5 ma, r educe v3p3 until v2p5 drops 200 mv 470 mv pssr ? v2p5/ ? v3p3 reset=0, iload=0 -2 +2 mv/v 5.4.8 l ow -p ower v oltage r egulator unless otherwise specified, v3p3sys = v3p3a = 0, pb=gnd (brownout) . table 77 : low - power voltage regulator performance specifications p arameter c ondition m in t yp max unit v2p5 i load = 0 2. 3 2.5 2.7 v v2p5 load regulation i load = 0 ma to 1 ma 30 mv vbat voltage requirement i load = 1 ma, r educe vbat until reg_lp_ok = 0 3.0 v psrr v2p5/vbat i load = 0 - 50 50 mv/v downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 102 rev 2 5.4.9 c rystal o scillator table 78 : crystal oscillator performance specifications p arameter c ondition m in t yp max unit maximum output power to crystal 4 crystal connected 1 w xin to xout capacitance 1 3 pf capacitance to gndd 1 xin xout rtca_adj[6:0] = 0 5 5 pf pf 5.4.10 lcd dac table 79 : lcd dac performance specifications p arameter c ondition m in t yp max unit vlcd voltage v 019 .0 lcd_dac) 059 .0 1(3p3v v lcd ? ? ? ? = 1 lcd_dac[2:0] 7 - 10 +10 % 5.4.11 lcd d rivers the information in table 80 a pplies to all com and seg pins with lcd_dac[2:0] = 000 . table 80 : lcd driver performance specifications p arameter c ondition m in t yp max unit vlc2 voltage with respect to vlcd 1 - 0.1 +0 .1 v vlc1 voltage ? , ? bias ? bias ? bias, minimum output level with respect to 2*vlc2/3 with respect to vlc2/2 -3 -3 +2 +2 1.0 % vlc2 % vlc2 v vlc0 voltage, ? bias with respect to vlc2/3 -4 +1 % vlc1 impedance ?i load = 100 a ( isink) 9 15 k ?i load = - 100 a ( isource) 9 15 vlc0 impedance ?i load = 100 a ( isink) 9 15 k ?i load = - 100 a ( isource) 9 15 1 vlcd is v3p3sys in mission mode and vbat in brownout and lcd modes. ? specified as percentage of vlc2, the maximum lcd voltage. 5.4.12 optical interface table 81 : optical interface performance specifications p arameter c ondition m in t yp max unit opt_tx v oh (v3p3d - opt_tx) i source =1 ma 0.4 v opt_tx v ol i sink = 20 ma 0.7 v downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 103 5.4.13 temperature s ensor table 82 shows the performance for the temperature sensor . the lsb values do not include the 8- bit left shift at ce input. table 82 : temperature sensor performance specifications p arameter c ondition m in t yp max unit nominal relationship: n(t) = s n * (t -t n ) + n n , t n = 25oc nominal sens i- ti v ity (s n ) 2 3 3 00109 .0 ?? ? ?? ? ? ?= l s n [ m40mhz , m26mh ] = [00], [10], or [11] fir_len[1:0] =0 (l=138) fir_len[1:0] =1 (l=288) fir_len[1:0] =2 (l=384) - 106 - 964 - 2286 lsb/oc [ m40mhz , m26mhz ] = [01] fir_len[1:0] =0 (l=186) fir_len[1:0] =1 (l=384) fir_len[1:0] =2 (l=588) - 260 - 2286 - 8207 nominaloffset (n n ) 2 3 3 508 .0 ?? ? ?? ? ? = l n n [ m40mhz , m26mhz ] = [00], [10], or [11] fir_len[1:0] =0 (l=138) fir_len[1:0] =1 (l=288) fir_len[1:0] =2 (l=384) 49447 449446 1065353 lsb [ m40mhz , m26mhz ] = [01] fir_len[1:0] =0 (l=186) fir_len[1:0] =1 (l=384) fir_len[1:0] =2 (l=588) 121 0 71 106535 3 3 82500 4 temperature error ? ? ? ? ? ? ? ? ? = n n s n tn t err ) )(( t n = 25c , t = - 40oc to +85oc - 10 1 + 10 1 oc ? temperature error is calculated with the value n n , which is measured at t n during meter calibration and is stored in mpu or ce for use in temperature calculations. 1 guaranteed by design; not production tested. 2 this specification defines a nominal relationship rather than a measured parameter . correct circuit o p- eration is be verified with other specifications that use this nominal relationship as a reference. 5.4.14 vref table 83 shows the performance specificat i ons for vref . u nless otherwise specified, vref_dis = 0. table 83 : vref performance specifications p arameter c ondition m in t yp max unit vref output voltage, vref(22 ) ta = 22oc 1.193 1.195 1.197 v vref chop step 40 mv vref power supply sensitivity vref / v3p3a v3p3a = 3.0 to 3.6 v - 1.5 1.5 mv/v vref input impedance vref_dis = 1 , vref = 1.3 to 1.7 v 100 k downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 104 rev 2 p arameter c ondition m in t yp max unit vref output impedance cal =1, i load = 10 a, - 10 a 2.5 k vnom definition a 6 2 6 10 2 )22 ( 10 1 )22 ( )22( )( ? ? ? ? + ? ? + = tc t tc t vref t vnom v vnom temperature coefficients : tc1 tc2 3.18 (52.46 - trimt ) - 0.4 44 v /oc v /c 2 vref(t) deviation from vnom(t) )40,22 max( 10 )( )( )( 6 ? ? t t vnom t vnom t vref - 40 1 +40 1 ppm/oc vref aging 25 ppm / year 1 guaranteed by design; not production tested. a this relationship describes the nominal behavior of vref at different temperat ures. 5.4.15 adc converter , v3p3a referenced table 84 shows the performance specifications for the adc converter, v3p3a r eferenced. for this data, fir_len[1:0] =0, vref_dis =0 and lsb values do not include the 8 - bit left shift at the ce input. table 84 : adc converter performance specifications p arameter c ondition m in t yp max unit recommended input range (vin - v3p3a ) - 250 250 mv peak voltage to current crosstalk ) cos( * 10 6 vcrosstalk vin vin vcrosstalk ? vin = 200 mv peak, 65 hz, on va . vcrosstalk = largest measurement on ia or ib - 10 1 10 1 v/v thd (first 10 harmonics) 1 : 250 mv - pk 20 mv - pk vin=65 hz, 64 kpts fft, blackman - harris window ckce = 5 mhz - 75 - 90 db db input impedance vin = 65 hz 40 90 k temperature coefficient of input i m- pedance vin = 65 hz 1.7 /c lsb size 3 3 75.4 25.1 ?? ? ?? ? ? ? = l v v ref lsb l = fir length [ m40mhz , m26mhz ] = [00], [10], or [11] fir_len[1:0] =0 fir_len[1:0] =1 fir_len[1:0] =2 3231 355 150 nv/ lsb [ m40mhz , m26mhz ] = [01] fir_len[1:0] =0 fir_len[1:0] =1 fir_len[1:0] =2 1319 150 42 nv/ lsb digital full scale 3 3 ?? ? ?? ? l l = fir length [ m40mhz , m26mhz ] = [00], [10], or [11] fir_len[1:0] =0 fir_len[1:0] =1 fir_len[1:0] =2 97336 884736 2097152 lsb [ m40mhz , m26mhz ] = [01] fir_len[1:0] =0 fir_len[1:0] =1 fir_len[1:0] =2 238328 2097152 7529536 lsb downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 105 a dc gain error versus %power supply variation 3.3/3 3 100 / 357 10 6 a p v v nv nout in pk ? ? vin=200 mv pk, 65 hz v3p3a=3.0 v, 3.6 v 50 ppm/% input offset (vin - v3p3a ) - 10 10 mv 1 guaranteed by design; not production tested. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 106 rev 2 5.5 t iming s pecifications 5.5.1 flash memory table 85 : flash memor y timing specifications p arameter c ondition m in t yp max unit flash read pulse width v3p3a = v3p3sys = 0 (brownout mode) 30 100 ns flash write cycles - 40c to +85c 20,000 cycles flash data retention 25c 100 years flash data retention 85c 10 years flash byte write operations between page or mass erase operations 2 cycles write time per byte 42 s page erase (1024 bytes) 20 ms mass erase 200 ms 5.5.2 eeprom i nterface table 86 : eeprom interface timing p arameter c ondition m in t yp max unit write clock frequency (i 2 c) ckmpu = 4.9 mhz, using interrupts 78 khz ckmpu = 4.9 mhz, bit - banging dio4/5 150 khz write clock frequency (3 - wire) ckmpu=4.9 mhz 500 khz 5.5.3 r eset table 87 : reset timing p arameter c ondition m in t yp max unit reset pulse width 5 s reset pulse fall time 1 1 s 1 guaranteed by design; not production tested. 5.5.4 rtc p arameter c ondition m in t yp max unit range for date 2000 2255 year downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 107 5.5.5 spi slave p ort ( mission m ode) table 88 : spi slave port (mission mode) timing p arameter c ondition m in t yp max unit t spicyc pclk cycle time 1 s t spilead enable lead time 15 ns t spilag enable lag time 0 ns t spiw pclk pulse width : high low 40 40 ns ns t spisck pcsz to first pclk fall ignore if pclk is low when pcsz falls. 2 ns t spidis disable time 0 ns t spiev pclk to data out 15 ns t spisu data input setup time 10 ns t spih data input hold time 5 ns msb out lsb out msb in lsb in t spicyc t spilead t spilag t spisck t spih t spiw t spiev t spiw t spidis pcsz pclk psdi psdo figure 44 : spi slave port ( mission mode ) timing electrical specification f ootnotes 1. this spec will be guaranteed and verified in production samples, but will not be meas ured in production. 2. this spec will be guaranteed and verified in production samples, but will be measured in produc tion only at dc. 3. this spec will be measured in production at the limits of the specified operating temperature. 4. this spec defines a nominal relationship rather than a measured parameter . correct circuit operation will be verified with other specs that use this nominal relationship as a reference. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 108 rev 2 5.6 t ypical performance d ata 5.6.1 accuracy over current figure 45 shows accuracy over current for various load angles at room temperature. figure 45 : wh accuracy, 0.1 a to 200 a at 240 v/50 hz and room temperature 5.6.2 accuracy over temperature with digital temperature compensation enabled , the temperature characteristics of the reference voltage (vref) are compensated to within 40 ppm/c (see section 3.4 for details). downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 109 5.7 71m6531d/f package 5.7.1 p ackage outline figure 46 : qfn - 68 package outline, top and side view figure 47 : qfn - 68 package outline, bottom view * pin length is nominally 0.4 mm (min = 0.3 mm, max = 0.4 mm). ** exposed pad is internally connected to gndd. *** pin 1 is marked on bottom with notch or chamfered corner in the exposed pad next to pin 1. side view top view pin #1 dot by marking 68 2 1 8.000 0.050 8.000 0.050 0.000 0.050 0.203 ref 0.850 0.050 pin #1 id r0.20, or chamfer 0.500 x 45 bottom view 68 1 2 6.300 0.100 exp. pad 6.300 0.100 exp. pad 6.400 ref. 0.400 0.050 0.400 bsc 0.200 0.050 downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 110 rev 2 5.7.2 71m6531d/f pinout (qfn - 68) figure 48 : pinout for qfn - 68 package downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 111 5.7.3 recommended pcb land pattern for the qfn - 68 package figure 49 : pcb land pattern for qfn 68 package table 89 : recommended pcb land pattern dimensions symbol description typical dimension e lead pitch 0.4mm x pad width 0.23mm y pad length, see note 3 0.8mm d see note 1 6.3mm a 6.63mm g 7.2mm notes: 1. do not place unmasked vias in the region denoted by dimension d . 2. soldering of bottom internal pad is not required for proper operation. 3. the y dimension has been elongated to allow for hand soldering and reworking . production assembly may allow this dimension to be reduced as long as the g dimension is maintained. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 112 rev 2 5.8 71m6532d/f package 5.8.1 71m6532d/f pinout (l qfp - 100 ) figure 50 : pcb land pattern for lqfp - 100 package downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 113 5.8.2 lqfp - 100 mechanical drawing figure 51 : lqfp - 100 package, mechanical drawing (dimensions are in mm.) 1 15.7(0.618)16.3(0.641) 15.7(0.618)16.3(0.641) top view max. 1.600 0.50 typ. 14.000 +/- 0.200 0.225 +/- 0.045 0.60 typ> 1.50 +/- 0.10 0.10 +/- 0.10 side view downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 114 rev 2 5.9 pin d escriptions pin types: p = power, o = output, i = input, i/o = input/output the circuit number denotes the equivalent circuit, as specified under section 5.9.4 i/o equivalent circuits . 5.9.1 power and ground pins table 90 : power and ground pins name type circuit description gnda p C analog ground: this pin should be connected directly to the ground plane. gndd p C digital ground: this pin should be connected directly to the ground plane. v3p3a p C analog power supply: a 3.3 v power supply should be connected to this pin, must be the same voltage as v3p3sys. v3p3sys p C system 3.3 v supply. this pin should be connected to a 3.3 v power supply. v3p3d o 13 auxiliary voltage output of the chip, controlled by the internal 3.3 v selection switch . in mission mode, this pin is internally connected to v3p3sys . in brownout mode, it is internally connected to vbat . this pin is floating in lcd and sleep mode. a bypass capacitor to ground should not e x- ceed 0.1 f. vbat p 12 battery backup and oscillator power supply . a battery or super - capacitor is to be connected between vbat and gndd . if no battery is used, connect vbat to v3p3sys. v2p5 o 10 output of the internal 2.5 v regulator . a 0.1 f capacitor to gnda should be connected to this pin. 5.9.2 analog pins table 91 : analog pins name type circuit description ia, ib iap/ian, ibp/ibn 1) i 6 line current sense inputs: these pins are voltage inputs to the internal a/d converter . typically, they are connected to the outputs of current sensors . unused pins must be tied to v3p3a . va, vb , vx 1) i 6 line voltage sense inputs: these pins are voltage inputs to the internal a/d converter . typically, they are connected to the outputs of resistor dividers . unused pins must be tied to v3p3a. the vx pin is not supported by standard ce code. v1 i 7 comparator input: this pin is a voltage input to the internal comparator . the voltage applied to the pin is compared to the internal bias voltage (1.6 v) . if the input voltage is above vbias, the comparator output will be high (1) . if the comparator output is low, a voltage fault will occur . a s eries resistor should be connected from v1 to the resistor divider to pro vide hysteresis . vref o 9 voltage reference for the adc . normally disabled and left unconnected. if en abled, a 0.1 f capacitor to v3p3a should be connected to this pin. xin xout i 8 crystal inputs: a 32 khz crystal should be connected across these pins . typically, a 33 pf capacitor is also connected from xin to gnda and a 15 pf capacitor is connected from xout to gnda . it is important to mi nimize the capacitance between these pins . see the crystal manufacturer datasheet for details. if an external clock is used, a 150 mv (p - p) clock signal should be applied to xin, and xout should be left unconnected. 1) differential pin pairs iap/ian and ibp/ibn, as well as single - ended vx pin used on 71m6532d/f o nly. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 115 5.9.3 digital pins table 92 : digital pins name type circuit description com3,com2, com1, com0 o 5 lcd common outputs: these 4 pins provide the select signals for the lcd display. seg0seg2, seg7, seg8 seg12seg18 o 5 dedicated lcd segment output pins. seg 2 0seg2 3 o 5 dedicated lcd segment output pins (71m6532d/f only). seg24/dio4 seg35/dio15 , seg37/dio17 , seg48/dio28, seg49/dio29 , seg63/dio43 seg66/dio46 i/o 3, 4, 5 multi - use pins, configurable as either lcd seg driver or dio. (dio4 = sck, dio5 = sda when configured as eeprom interface; wpulse = dio6, varpulse = dio7 when configured as pulse output s). unused pins must be configured as outputs or terminate d to v3p3/gndd. 1) seg3/pclk seg4/psdo seg5/pcsz seg6/psdi i/o 3, 4, 5 multi - use pins, configurable as either lcd seg driver or spi port. e_rxtx/seg9 i/o 1, 4, 5 multi - use pins, configurable as either emulator port pins (when ice_e pulled high) or lcd seg drivers (when ice_e tied to gnd). e_rst/seg11 i/o 1, 4, 5 e_tclk/seg10 o 4, 5 ice_e i 2 ice enable. when zero, e_rst, e_tclk and e_rxtx become seg32, seg33 and seg38 respectively. for production units, this pin should be pulled to gnd to disable the emulator port. cktest/seg19 , muxsync/seg7 o 4, 5 multi - use pin s , configurable as either multiplexer/clock output or lcd segment driver using the i/o ram registers ckout_e or mux_sync_e. tmuxout o 4 digital output test multiplexer. controlled by t mux[3:0]. opt_rx/dio1 i/o 3, 4, 7 multi - use pin, configurable as optical receive input or general dio. when configured as opt_rx, this pin receives a signal from an ex ternal photo - detector used in an ir serial interface. if this pin is unused it must be configured as an output or terminated to v3p3d or gndd. opt_tx/dio2 i/o 3, 4 multi -u se pin, configurable as either optical led transmit o utput, wpulse, rpulse, or general dio. when configured as opt_tx, this pin is capable of directly driving an led for transmitting data in an ir serial interface. reset i 2 chip reset: this input pin is used to reset the chip into a known state. for normal operation, this pin is pulled low. to reset the chip, th is pin should be pulled high. this pin has an internal 30 a (nominal) current source pull - down. no external reset circuitry is necessary. rx i 3 uart input. if this pin is unused it must be configured as an out put or terminated to v3p3d or gndd. tx o 4 uart output. test i 7 enables production test. this pin must be grounded in normal operation. pb i 3 push button input. this pin must be at gndd when not active. a rising edge sets the ie_pb flag. it also causes the part to wake up if it is in sleep or lcd mode. pb does not have an internal pull - up or pull - down. 1) n ot all pins available on the 71m6531 d/f or 71m6532d/f. downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 116 rev 2 5.9.4 i/o equivalent circuits figure 52 : i/o equivalent circuits oscillator equivalent circuit type 8: oscillator i/o digital input equivalent circuit type 1: standard digital input or pin configured as dio input with internal pull-up gndd 110k v3p3d cmos input v3p3d digital input pin digital input type 2: pin configured as dio input with internal pull-down gndd 110k gndd cmos input v3p3d digital input pin digital input type 3: standard digital input or pin configured as dio input gndd cmos input v3p3d digital input pin cmos output gndd v3p3d gndd v3p3d digital output equivalent circuit type 4: standard digital output or pin configured as dio output digital output pin lcd output equivalent circuit type 5: lcd seg or pin configured as lcd seg lcd driver gndd lcd seg output pin to mux gnda v3p3a analog input equivalent circuit type 6 : adc input analog input pin comparator input equivalent circuit type 7: comparator input gnda v3p3a to comparator comparator input pin to oscillator gndd oscillator pin vref equivalent circuit type 9: vref from internal reference gnda v3p3a vref pin v2p5 equivalent circuit type 10: v2p5 from internal reference gndd v3p3d v2p5 pin vlcd equivalent circuit type 11: vlcd power gndd lcd drivers vlcd pin vbat equivalent circuit type 12: vbat power gndd power down circuits vbat pin v3p3d equivalent circuit type 13: v3p3d from v3p3sys v3p3d pin from vbat 1040 downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 117 6 o rdering i nformation part p art description (package) flash size pack aging order number package mar k- ing 71m6531d 68 - pin qfn, lead free 128 kb bulk 71m6531d - im/f 71m6531d - im 71m6531d 128 kb tape and reel 71m6531d - imr/f 71m6531d - im 71m6531f 256 kb bulk 71m6531f - im/f 71m6531f - im 71m6531f 256 kb tape and reel 71m6531f - imr/f 71m6531f - im 71m6532d 100 - pin lqfp, lead free 128 kb bulk 71m6532d - igt/f 71m6532d - igt 71m6532d 128 kb tape and reel 71m6532d - igtr /f 71m6532d - igt 71m6532f 256 kb bulk 71m6532f - igt/f 71m6532f - igt 71m6532f 256 kb tape and reel 71m6532f - igtr/f 71m6532f - igt 7 related information users must also refer to the following documents related to the 71m6531 d/f and 71m6532d/f : ? 71m653 x software users guide (sug _653x ) ? demo board users guide (dbum_6531) ? application note on m igration from the 6521 to the 6531 (an_6531_001) other essential application notes can be found at the maxim web site: http://www.maximintegrated.com/datasheet/index.mvp/id/685 4/t/do 8 contact information for more information about maxim products or to check the availability of the 7 1m6531d/f and 71m6532d/f , contact technical support at https://support.maximintegrated.com . downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 118 rev 2 appendix a: acronyms afe analog front end amr automatic meter reading ansi american national standards institute ce compute engine dio digital i /o dsp digital signal processor fir finite impulse response i 2 c inter - ic bus ice in - circuit emulator iec international electrotechnical commission mpu microprocessor unit (cpu) pll phase - locked loop r ms root mean square sfr special function register soc system on chip spi serial peripheral interface tou time of use uart universal asynchronous receiver/transmitter downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 119 appendix b: revision history revision date description 2 march 26 , 2013 1) added guaranteed by design notes to the electrical specific a- tions (section 5 ). 2) added explanation on nv properties of rtca_adj [ ] and preg/qreg [ ] (section 1.5.3 ) and corrected entries in table 55 . 3) a dded note that transitions to brownout mode must be avoi d- ed during page erase operations (section 1.5.5 ). 4) added n ote in application section 3.1 statin g that filter com - ponents other that those shown on the demo boards should not be connected to the sensor input pins. added reference to an5292. 5) con solidated spelling of low - power modes (sleep, brown - out ) and of compstat register. 6) corrected value for c2 capacitor i n table 68 . 7) extended explanation of wd_ovf (not preserved in sleep mode) and corrected entries in table 55 . 8) added explanation of wd_nrovf_flag ( section 1.4.9 ) . 9) added explanation of mpu activity on transition to brownout mode in s ection 2.4.2 . 10) swapped the order of the individual flags and individual enable bits in figure 8 . 1.3 june 9 , 2010 1) throughout document: added bit ranges to all register fields where missing (e.g. mpu_div[2:0]). 2) figure 1 , figure 2 : corrected name for psdi and psdo signals . 3) 1.4 80515 mpu core ? added sfr register addresses where needed. ? (page 19 ) table 6 : change approximate frequencies to exact frequencies. ? (page 19) changed provi ding library to providing demonstration source code. ? (page 20) added note about mux_div =0 disables adc output. ? (page 21 ) see restrictions on intbits register. ? (pag e 22 ) added p1 - p3 to table 10 . ? (page 23) updated data pointer description. ? (page 24 ) table 14 : updated description for fwcol0 , fwcol1 . ? (page 26 ) 1.4.6 uarts : clarified sobuf , s1buf as tx and rx buffers. ? (page 27 ) added caution on proper way to clear flag bits. ? (page 30 ) 1.4.9 interrupts : clarified external vs internal interrupts. ? (page 31 ) table 25 : added interrupt sources for ext. interrupts 2 - 6. 4) 1.5.2 internal clocks ? (page 36 ) table 37 : changed frequencies to exact frequencies. ? (page 38) added caution concerning frequency relationship to specific ce code. 5) 1.5.3 real - time clock (rtc) : (page 39) added description for obse rving rtc timing on tmuxout pin, corrected values for rtca_adj , and achievable frequency step. 6) 1.5.9 digital i o C common characteristics for 71m6531d/f and 71m6532d/f (pa ge 45 ): ? a dded caution about not sou rcing current in or out of dio pins. ? updated figure 10 : connecting an external load to dio pins . 7) 1 .5.13 battery monitor (page 46 ): corrected ram address for adc data. 8) 1.5.15 spi slave port (page 49 ) : c larified description of i/o ram downloaded from: http:///
data sheet 71m6531d/f - 71m6532d/f fds 6531/6532 005 120 rev 2 access via the spi interface. added table 50 . 9) 2.3 battery modes (page 56 , 57 ): added details on software pr e- cautions for switching between modes and factory programming o f the first 6 flash addresses. 10) 3.1 connection of sensors (page 63 ): added note concerning analog input pins requiring sensors with low source impedance. 11) 3.15 mpu firmware (page 70 ): modified to indicate demonstration source code provided. 12) 3.16 crystal oscillator (page 70 ): updated caution concerning rejecting electromagnetic interference. 13) table 54 : i/o ram map in functional order (page 72 ) : updated unused and nvram locations. 14) 4.3.4 environment : added comment concerning importance of parameter dependence on ce code e nvironment. 15) 4.3.6 ce status and control ( page 89 ): ? updated description of f0 in table 57 . ? updated descriptions in table 58 (page 91 ). 16) 4.3.7 ce transfer variables : updated description of vbat_sum_x in table 63 (page 93 ) . 17) corrected values for ext_pulse in description of internal pulse generation (page 89 ). 18) updated pin - out for qfn - 68 package ( figure 48 ). 19) added explanation for in sqres_x. 20) added explanation of delay compensation in ce ( 1.3.5 ). 21) added explanation on temperature coefficients for verf in appl i- cation section ( 3.4.1 ). 22) corrected figure 30 (right side). 1.2 october 21, 2009 updated number range for rtc_adj to 0 C 0x7f and tolerance for ex - posed pad in figure 46 to 0.1 mm. corrected bit range for ce_lctn to [7:0] and functional description for tmod[7] and tmod[3] in table 22. added maximum value for wrate and text stating that registers rtc_sec to rtc_yr do not change at reset. added v lsb entry for sag detection in ce interface description, text regarding hysteresis at section 3.10, note that vx pin is not supported by standard ce code, and description of stop and idle bits in pcon register. changed value for wh accuracy percentage on title page (value stated for room temperature). 1.1 july 27, 2009 updated mechanical drawing for qfn - 68 package. replaced figure 19 with single - phase example. corrected lqfp - 100 package drawing (figure 50). applied minor corrections and enhancements to diagrams. 1.0 february 27, 2009 initial release. changes with respect to pds v1.3: 1) corrected timer/counter 0/1 label in table 22. 2) corrected entries for dio29 and dio43 in table 39. 3) updated unused/reserved bits in i/o ram tables, added descri p- tion for we register. 4) documented blink capability for both seg18 and seg19. 5) changed package for 71m6532d/f to lqfp - 100, updated all pin tables and i/o ram tables accordingly. 6) replaced graph showing system performance specification over temperature with specification on accuracy of vref compens a- tion. 7) added explanation for hysteresis at the v1 pin in applications section. 8) added note on recommended bypass capacitors c1 and c2 in electrical specification. downloaded from: http:///
fds 6531/6532 005 data sheet 71m6531d/f - 71m6532d /f rev 2 121 9) rem oved access to i/o ram from spi port description. 10) updated numerous parameters in electrical specification (te m- perature sensor, supply current for mission and battery modes). 11) corrected number of pre - boot cycles in flash memory section. 12) updated entries in i/o ram table under wake column. maxim integrated cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a maxim integrated product. n o circuit patent licen s es are implied. maxim integrated reserves the right to change the c ircuitry and specifications without notice at any time. the parametric values (min and max limits) shown in the electrical characteristics table are g uaranteed. other parametric values quoted in this data sheet are provided for guidance. maxim integrated 160 rio robles, san jose, ca 95134 usa 1 - 408 - 601 - 1000 ? 2012 maxim integrated products, inc. maxim integrated and the maxim integrated logo are trademarks of maxim integrated produc ts, inc. downloaded from: http:///


▲Up To Search▲   

 
Price & Availability of 71M6531F-IMFPE8

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X